The TSX was slightly higher Thursday with strength coming from mining stocks while the market gave a tepid reception to higher profits at Royal Bank (TSX:RY) and CIBC (TSX:CM).The S&P/TSX composite index was up 16.4 points to 12,749.01 as Royal Bank posted $1.9 billion of net income in the second quarter, up 26 per cent from a year earlier. The profit amounted to $1.27 share while adjusted diluted EPS was $1.31, which met a Thomson Reuters estimate but missed a Bloomberg estimate by a penny. RBC shares lost $1.24 to $62.74.CIBC had a second-quarter profit of $876-million, up eight per cent from a year ago. Its net income and adjusted net income both came in at $2.12 per share, above the consensus estimate. CIBC said its quarterly dividend will rise by two cents to 96 cents per share.CIBC also said it has taken steps to create alternatives in case it does not renew its Aeroplan credit card agreement with Aimia (TSX:AIM), which is set to expire at the end of the year. President and chief executive Gerry McCaughey didn’t rule out the possibility of renewing the existing contract with the company formerly known as Aeroplan, which has partnered with the bank for more than two decades to create the popular CIBC Aerogold Visa. CIBC shares dipped 70 cents to $79.73 while Aimia slipped 11 cents to $15.06.The Canadian dollar was ahead 0.45 of a cent to 97.05 cents US amid rising prices for gold and copper.U.S. markets were positive amid a slightly weaker than expected showing in U.S. economic growth during the first quarter, a rise in jobless insurance claims and an indication of further strength in home sales in the coming months.The Dow Jones industrials rose 42.56 points to 15,345.36, the Nasdaq gained 21.59 points to 3,489.11 while the S&P 500 index rose 6.89 points to 1,655.25.A second reading on U.S. gross domestic product for the first quarter showed GDP coming in at an annualized rate of 2.4 per cent, a bit below the initial reading of a 2.5 per cent gain. But the showing was still a marked improvement from the 0.4 per cent gain in the final quarter of 2012.The number of Americans seeking unemployment aid rose 10,000 last week to a seasonally adjusted 354,000, a sign layoffs have increased. The Labour Department also said the four-week average, a less volatile measure, increased 6,750 to 347,250, the third straight gain. The average had fallen to a five-year low of 338,000 earlier this month.On the housing front, the National Association of Realtors says its seasonally adjusted index for pending U.S. home sales rose 0.3 per cent to 106, the highest since April 2010, when a homebuyer tax credit inflated sales. Signed contracts have jumped 10.3 per cent in the past 12 months. Also, sales of previously occupied U.S. homes rose in April to a seasonally adjusted annual rate of 4.97 million, a 3 1/2 year high.The gold sector led TSX advancers, up 4.5 per cent while gold was up $23.70 to US$1,415 an ounce. Barrick Gold Corp. (TSX:ABX) jumped $1.35 to C$21.88 while Goldcorp Inc. (TSX:G) ran ahead $1.20 to $29.90.The base metals sector rose 1.54 per cent as copper futures were ahead two cents at US$3.32 a pound. Teck Resources (TSX:TCK.B) advanced 91 cents to C$28.81.Most bank stocks were lower, taking the financial sector down 0.4 per cent as Bank of Montreal (TSX:BMO) shed 39 cents to $62.11.The energy sector fell 0.2 per cent as oil prices backed off for a second day as the July crude contract on the New York Mercantile Exchange was off the worst levels of the session, down 44 cents to US$92.69 a barrel.Data from the U.S. Energy Department’s Energy Information Administration is expected to show a decline of 1.5 million barrels in crude oil stocks, according to a survey of analysts by Platts, the energy information arm of McGraw-Hill Cos.Canadian Natural Resources (TSX:CNQ) was down 25 cents to C$31.83.Traders also looked to a meeting of the Organization of Petroleum Exporting Countries Friday to discuss, among other things, production levels.Overhanging the meeting is the rise of shale oil production in the U.S. and a report from the International Energy Agency saying total production could top nine million barrels a day by 2018. That would mean near self-sufficiency for the U.S. as well as significantly less dependence on OPEC imports.In other corporate news, shares in Facebook Inc. jumped $1.25 or 5.36 per cent to US$24.57 after BMO Capital Markets analyst Daniel Salmon raised his rating on the social-networking giant to outperform from market perform. Salmon also lifted his price target on Facebook’s stock to $33 a share from $32, saying “sentiment around Facebook advertising remains quite positive.”European bourses advanced with London’s FTSE 100 index ahead 0.19 per cent, Frankfurt’s DAX was up 0.64 per cent while the Paris CAC 40 gained 0.58 per cent. read more