U.S. stocks rallied, almost wiping out this year’s decline in the Standard & Poor’s 500 Index, amid takeover deals, higher-than-estimated earnings at Caterpillar Inc. (CAT) and progress in talks to tame Europe’s debt crisis. Gauges of commodity, financial and technology shares had the biggest gains in the S&P 500 among 10 groups, rising at least 1.9 percent. Caterpillar, the largest construction and mining-equipment maker, climbed 5 percent. RightNow Technologies Inc. (RNOW) surged 19 percent, while Healthspring Inc. (HS) soared 34 percent, on acquisitions. Alcoa Inc. (AA) added 3.4 percent as metals advanced on signs of growth in China and Japan.