Despite some late-session losses, the S&P 500 still ended with its strongest weekly performance since March. Big companies continued to outpace their smaller peers.