Net income attributable to shareholders more than doubled to $4.99 billion, or 45 cents per share, in the second quarter from $2.04 billion, or 19 cents per share, a year earlier. BofA’s shares were up 2.9 percent at $17.62 in premarket trading. The bank’s profit in the year-earlier quarter was dragged down by $4 billion of legal expenses linked to mortgage disputes stemming from the financial crisis.