NEW YORK - U.S. stocks rose Monday as a mix of smaller, U.S.-focused companies, technology firms, and banks climbed. Drugmakers struggled, which limited those gains.

Companies that sell opioid pain medications tumbled after the government released a new, much higher estimate of the costs of the ongoing addiction crisis. Merck fell after a good report from competitor Roche about a drug that competes with Merck's cancer medication Keytruda.

The Standard & Poor's 500 index picked up 3.29 points, or 0.1 percent, to 2,582.14. The Dow Jones industrial average gained 72.09 points, or 0.3 percent, to 23,430.33. The Nasdaq composite advanced 7.92 points, or 0.1 percent, to 6,790.71. The Russell 2000 index of smaller-company stocks climbed 10.57 points, or 0.7 percent, to 1,503.40.

Chipmaker Marvell Technology Group said it would buy competitor Cavium for $6 billion. Cavium jumped $8.19, or 10.8 percent, to $84.02 and it's up 22 percent over the last two weeks on reports Marvell would make a bid. Marvell rose $1.30, or 6.4 percent, to $21.59.

Allergan gave up $3.76, or 2.2 percent, to $171.12, and Teva Pharmaceutical Industries fell 76 cents, or 5.5 percent, to $13.08. Insys Therapeutics shed 17 cents, or 3.2 percent, to $5.20.

Merck stumbled after Genentech, a unit of Swiss drugmaker Roche, reported positive results from a study of its drug Tecentriq as a primary treatment for lung cancer. Genentech said patients who were given Tecentriq as part of their treatment regimen were less likely to die or see their cancer get worse.

Merck fell $1.10, or 2 percent, to $54.10 and Bristol-Myers Squibb lost 52 cents to $60.80.

Benchmark U.S. crude fell 46 cents to $56.09 a barrel in New York.

The dollar rose to 112.67 yen from 112.13 yen late Friday. The euro slipped to $1.1732 from $1.1796 after a group of German political parties couldn't agree to form a government, which might mean new elections are on the way.

Gold slumped $21.20, or 1.6 percent, to $1,275.30 an ounce. Silver sank 53 cents, or 3.1 percent, to $16.84 an ounce. Copper gained 3 cents to $3.09 a pound.