Stocks edged up on Monday as a cost-cutting plan from General Motors Corp and a rebound in technology stocks offset fears that a possible global flu outbreak could delay an economic recovery.

GM shares surged 25 percent after the troubled automaker announced a sweeping restructuring that investors hoped would keep the company alive as it tries to secure government funding.

Cell-phone chip supplier Qualcomm Inc was a bright spot on the Nasdaq, up 6 percent at $43.82 after it swung to a quarterly loss but raised its full-year revenue target on signs of market improvement.

The market opened lower as governments around the world moved to contain the spread of a possible swine flu outbreak, as a virus that is believed to have killed over 100 people in Mexico spread to the United States and Canada and may have reached as far as New Zealand.

But recent data has suggested the recession could be abating, and quarterly earnings have been less disappointing than Wall Street expected. Investors who bet the market would fall on fears about the flu outbreak were forced to reverse their bets and buy stocks.

Anybody who shorted the opening, thinking that this swine flu was going to break the levels that we've been at, was wrong. said Joe Saluzzi, co-manager of trading at Themis Trading in Chatham, New Jersey.

The only real economic story is that GM appears to be doing well.

The Dow Jones industrial average <.DJI> gained 21.34 points, or 0.26 percent, to 8,097.63. The Standard & Poor's 500 Index <.SPX> rose 0.20 points, or 0.02 percent, to 866.43. The Nasdaq Composite Index <.IXIC> gained 2.08 points, or 0.12 percent, to 1,696.37.

(Reporting by Rodrigo Campos; editing by Jeffrey Benkoe)