BoA got 20B in TARP funds specifically to offset that loss. It's hard to know how much of their further 118B of Federal guarantees against losses and Geithner-knows how much free money from the discount window and Fed purchases of terrible securities can be attributed to their agreeing to buy Merrill.
But I think it's fair to say BoA didn't lose anything close to even 8B by the time the deal was done.
The TARP money wasn't a gift, nor is the money borrowed from the Fed.
It's not easy to know how much BofA actually lost on the deal because much of the reported losses at the time result from marking down assets according to market prices. I have no idea what they are worth now.
But I think it's fair to say BoA didn't lose anything close to even 8B by the time the deal was done.