* TSX up 138.28 points, or 1.21 percent, at 11,562.98 * Energy stocks lead rally as oil rises * RIM falls after earnings; new phones delayed By Allison Martell TORONTO, June 29 (Reuters) - Canada's main stock index jumped on Friday as commodity-linked shares rose on news euro zone leaders agreed on measures to cut soaring borrowing costs in Italy and Spain and recapitalize banks, offsetting a sharp drop in Research in Motion Ltd. Oil and other commodities rallied on news of the deal, a sign the euro zone is adopting a more flexible approach to solving a debt crisis that has hampered global growth. "Positive news coming out of the European summit very late last night is pushing up, in fact, global commodity prices and also riskier assets such as equities," said Patricia Mohr, vice president, economics and commodity market specialist at Scotiabank. "I don't think the financial markets were expecting very much progress." At about 10:40 a.m. (1440 GMT) the Toronto Stock Exchange's S&P/TSX composite index was up 138.28 points, or 1.21 percent, at 11,562.98. The energy group played the biggest role in pulling the index higher, rising 2.7 percent as U.S. crude rebounded from Thursday's eight-month low. Suncor Energy was the most influential gainer, rising 3.6 percent to C$29.31. Gold and copper rallied, and commodities were broadly higher. The Thomson Reuters-Jefferies CRB Index was up 2.8 percent. The heavyweight materials group, which includes gold and base metal miners, rose 1.8 percent. The gains were partly offset by BlackBerry maker Research In Motion, down almost 20 percent after it reported a steeper-than-expected quarterly operating loss and deep job cuts, and delayed the make-or-break launch of its next-generation phones until next year. RIM did more than any other stock to keep the index from rising further. It was also the second most heavily traded stock on the exchange. In other company news, Canadian Pacific Railway Ltd named Hunter Harrison its chief executive, months after a boardroom shakeup triggered by William Ackman's Pershing Square Capital Management felled former CEO Fred Green. Its stock rose 1.5 percent to C$74.59.