NEW YORK — U.S. stocks made modest gains and set more records Monday as upheaval in oil-rich Saudi Arabia sent crude prices to two-year highs. Chipmakers and media companies climbed on deal reports, while phone and household goods companies sank.

U.S. crude oil reached its highest price since mid-2015 after dozens of Saudi princes and senior officials and businessmen were arrested as part of a purported corruption investigation. Saudi Arabia is the world’s largest exporter of oil, and investors wondered if the tumult could constrict oil supplies and drive prices higher. Energy companies jumped, with drilling companies making some of the biggest gains.

Chipmakers surged after Broadcom offered to buy competitor Qualcomm for $103 billion, which would be the largest technology acquisition ever if it’s completed. Wireless carriers Sprint and T-Mobile tumbled after they called off merger talks over the weekend, and reports that Sprint’s owner, Japanese conglomerate SoftBank, might buy cable company Charter Communications hammered shares of telecom giants AT&T and Verizon, which might face tougher competition.

Doug Coté, chief market strategist for Voya Investment Management, said in the years after the global economic crisis, companies combined so they could survive. But now that the global economy is doing much better, they’re merging for different reasons.

“Global economic growth is expanding somewhat rapidly and the M&A is looking to capitalize on the growth areas, in particular technology,” he said. “Any capital investment cycle will begin with technology.”

Companies that make and sell household goods slumped on weak quarterly results from CVS Health and food distributor Sysco. Late in the day, Twenty-First Century Fox and Disney both climbed after CNBC reported the two sides recently discussed a deal in which Disney would buy most of Fox’s assets. Those talks were said to have ended without an agreement.

The Standard & Poor’s 500 index rose 3.29 points, or 0.1 percent, to 2,591.13. The Dow Jones industrial average added 9.23 points, or less than 0.1 percent, to 23,548.42. The Nasdaq composite gained 22 points, or 0.3 percent, to 6,786.44. The Russell 2000 index of smaller-company stocks picked up 3.05 points, or 0.2 percent, to 1,497.96.

Broadcom’s unsolicited offer values Qualcomm at $70 a share, and it would combine two companies that control about 40 percent of the market for chips used in cellphones. Qualcomm stock has been battered this year as the company is stuck in a legal battle with its biggest customer, Apple. Combining with Broadcom might help Qualcomm end that dispute.

Qualcomm added 71 cents, or 1.1 percent, to $62.52 and Broadcom rose $3.89, or 1.4 percent, to $277.52. Qualcomm stock jumped 12.7 percent Friday on reports Broadcom was going to make an offer. Apple also rose $1.75, or 1 percent, to $174.25 as technology companies rose for the eighth straight day.

That wasn’t the only potential chip tie-up in the news. After the Wall Street Journal reported that Marvell Technologies is in talks to buy Cavium, Cavium advanced $8.16, or 12 percent, to $76.43 and Marvell rose $1.69, or 9.1 percent, to $20.20.

U.S. crude oil surged $1.71, or 3.1 percent, to $57.35 a barrel in New York. Brent crude, the international standard, climbed $2.20, or 3.5 percent, to $64.27 a barrel in London.