MSVC, by default, limits the number of sections generated by a single translation unit to 2^16. In a debug build, each function or method can require 4 sections, so it's not uncommon to hit it. The cl.exe option /BIGOBJ raises the limit.
I saw the problem when building tests for LLDB (but, interestingly, not for LLDB itself).