Object: Add support for bigobj
authorDavid Majnemer <david.majnemer@gmail.com>
Wed, 10 Sep 2014 12:51:52 +0000 (12:51 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Wed, 10 Sep 2014 12:51:52 +0000 (12:51 +0000)
commitb3a86a097be30c16620d06d180afcc26358f204e
tree1f9ebb12767aa846242d2fb072507e4830a1d36c
parentcfae729840a7b1e3281dc6274db0d0726332f556
Object: Add support for bigobj

This adds support for reading the "bigobj" variant of COFF produced by
cl's /bigobj and mingw's -mbig-obj.

The most significant difference that bigobj brings is more than 2**16
sections to COFF.

bigobj brings a few interesting differences with it:
- It doesn't have a Characteristics field in the file header.
- It doesn't have a SizeOfOptionalHeader field in the file header (it's
  only used in executable files).
- Auxiliary symbol records have the same width as a symbol table entry.
  Since symbol table entries are bigger, so are auxiliary symbol
  records.

Write support will come soon.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217496 91177308-0d34-0410-b5e6-96231b3b80d8
24 files changed:
include/llvm/Object/COFF.h
include/llvm/Support/COFF.h
lib/MC/WinCOFFObjectWriter.cpp
lib/Object/COFFObjectFile.cpp
test/MC/ARM/coff-file.s
test/MC/COFF/alias.s
test/MC/COFF/basic-coff-64.s
test/MC/COFF/basic-coff.s
test/MC/COFF/feat00.s
test/MC/COFF/file.s
test/MC/COFF/symbol-fragment-offset-64.s
test/MC/COFF/symbol-fragment-offset.s
test/MC/COFF/weak.s
test/tools/llvm-readobj/Inputs/bigobj.coff-x86-64 [new file with mode: 0644]
test/tools/llvm-readobj/bigobj.test [new file with mode: 0644]
test/tools/llvm-readobj/coff-file-sections-reading.test
test/tools/llvm-readobj/cxx-cli-aux.test
test/tools/llvm-readobj/sections-ext.test
test/tools/llvm-readobj/symbols.test
tools/llvm-nm/llvm-nm.cpp
tools/llvm-objdump/COFFDump.cpp
tools/llvm-objdump/llvm-objdump.cpp
tools/llvm-readobj/COFFDumper.cpp
tools/obj2yaml/coff2yaml.cpp