MC: Add support for BigObj
authorDavid Majnemer <david.majnemer@gmail.com>
Mon, 15 Sep 2014 19:42:42 +0000 (19:42 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Mon, 15 Sep 2014 19:42:42 +0000 (19:42 +0000)
commitf1198da05c67eb63d16749d0a477289be9c5a5c7
tree1486eccaed91934c2374fcaf59e36b268bf8b46a
parent46738fc43e13dab2bd46c7fead784bf1860d1701
MC: Add support for BigObj

Teach WinCOFFObjectWriter how to write -mbig-obj style object files;
these object files allow for more sections inside an object file.

Our support for BigObj is notably different from binutils and cl: we
implicitly upgrade object files to BigObj instead of asking the user to
compile the same file *again* but with another flag.  This matches up
with how LLVM treats ELF variants.

This was tested by forcing LLVM to always emit BigObj files and running
the entire test suite.  A specific test has also been added.

I've lowered the maximum number of sections in a normal COFF file,
VS "14" CTP 3 supports no more than 65279 sections.  This is important
otherwise we might not switch to BigObj quickly enough, leaving us with
a COFF file that we couldn't link.

yaml2obj support is all that remains to implement.

Differential Revision: http://reviews.llvm.org/D5349

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217812 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Object/COFF.h
include/llvm/Support/COFF.h
lib/MC/WinCOFFObjectWriter.cpp
tools/llvm-objdump/llvm-objdump.cpp
tools/llvm-readobj/COFFDumper.cpp
tools/obj2yaml/coff2yaml.cpp
tools/yaml2obj/yaml2coff.cpp