Stocks rose in a weak rally despite strong earnings from technology giants.