Stocks hold gains, S&P drifts near all-time high