A big chunk of the earnings shortfall stemmed from the bills that piled up as Yahoo dealt with an unsolicited takeover bid from Microsoft Corp. and a now-resolved battle for control of its board with activist investor Carl Icahn .