U.S. stocks rose Monday as investors were cheered by a spate of corporate dealmaking over the weekend. Technology companies made the biggest gains.

Companies announced almost $100 billion in deals over the last few days. Investors had mixed reactions to the moves, but they were pleased the companies were willing to spend.

advertisement | advertise on newsday

“Any time you see a lot of IPOs, a lot of merger activity, it boosts confidence,” said Karyn Cavanaugh, senior markets strategist for Voya Investment Strategies.

Big-name technology companies including Apple and Alphabet, which owns Google, rose ahead of reporting their earnings this week. Amazon also rose, giving other consumer companies a boost. Energy companies slipped with the price of oil.

The Dow Jones industrial average gained 77.32 points, or 0.4 percent, to 18,223.03. The Standard & Poor’s 500 index rose 10.17 points, or 0.5 percent, to 2,151.33. Thanks to the big gains for tech companies, the Nasdaq composite climbed 52.42 points, or 1 percent, to 5,309.83.

Aviation electronics company Rockwell Collins agreed to buy commercial aircraft and business jet maker B/E Aerospace for $62 a share, or $6.4 billion in cash and stock. B/E Aerospace climbed $8.28, or 16.4 percent, to $58.89 while Rockwell Collins gave up $5.25, or 6.2 percent, to $79.21.