The Toronto stock market ended higher Tuesday as surging technology issues offset sagging industrial and energy shares.

The S&P/TSX composite index closed up 43.89 points, or 0.31%, at 14,087.49.

Overall, six of the 10 main groups ended higher.

The tech sector was up 1.11%, boosted by Research in Motion.

RIM shares jumped $9.12, or 8.2%, to $120.42 after the BlackBerry maker said it had made a Chinese distribution deal with Alcatel-Lucent

The industrials sector fell 1.2%, dragged down by CN Rail one day after the company posted a 2% decline in third-quarter net income.

CN shares dropped $1.62, or 3.1%, at $50.00.

The materials sector rose 0.9%. after a two-session decline as gold prices rallied on bargain hunting.

Barrick Gold gained 79¢, or 2%, to $40.44 and Kinross Gold was up 21¢, or 1.3%, to $16.55.

Spot gold rose to US$759.20 an ounce on help from bargain hunting after the previous session’s sharp fall.

Energy issues slipped 0.5% as the price of oil declined.

Crude fell to US$85.27 a barrel on worries over the health of the U.S. economy.

Suncor Energy was down 67¢, or 0.7%, to $100.61, while Husky Energy slipped 19¢, or 0.4%, to $42.83.

The junior S&P/TSX Venture composite index climbed 39.45 points to 3,018.26.

The Canadian dollar ended the session up 1.51 cents at US103.51¢.

In New York, technology stocks rallied on Apple’s strong profit and the Chinese distribution deal RIM.

The tech-heavy Nasdaq Composite Index was up 45.33 points, or 1.65%, at 2,799.26.

The broader market also advanced. The Dow Jones industrial average was up 109.26 points, or 0.81%, to end at 13,676.23. The S&P 500 was up 13.26 points, or 0.88%, at 1,519.59.