US stocks extend rally to close at fresh records ahead of mega-cap earnings