Add WoA object file emission support
authorSaleem Abdulrasool <compnerd@compnerd.org>
Sun, 27 Apr 2014 03:48:22 +0000 (03:48 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Sun, 27 Apr 2014 03:48:22 +0000 (03:48 +0000)
commit2d0d7fd085014eb4217545be06f57397808983d0
treef8164fa024b928bb7366b1aa614bf614c979ab01
parent6c76c959e405c72574b7e0498ddcaee3e532ca15
Add WoA object file emission support

Introduce support for WoA PE/COFF object file emission from LLVM.  Add the new
target specific PE/COFF Streamer (ARMWinCOFFStreamer) that handles the ARM
specific behaviour of PE/COFF object emission.  ARM exception information is not
yet emitted and is a TODO item.

The ARM specific object writer (ARMWinCOFFObjectWriter) handles the ARM specific
relocation handling in conjunction with the WinCOFFObjectWriter in the MC layer.
The MC layer needs to be updated to deal with the relocation adjustments.
Branch relocations are adjusted by 4 bytes (unlikely their ELF counterparts).

Minor tweaks to switch multiple conditional checks into equivalent switch
statements.  The ObjectFileInfo is updated to relax the object file setup for
Windows COFF.  Move the architecture checks into an assertion.  Windows COFF is
currently only supported on x86, x86_64, and ARM (thumb).  Rather than
defaulting to ELF, we will refuse to generate an object file.  This is better
though as you do not get an (arbitrary) object file which is different from the
request.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207345 91177308-0d34-0410-b5e6-96231b3b80d8
lib/MC/MCObjectFileInfo.cpp
lib/MC/WinCOFFObjectWriter.cpp
lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp
lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h
lib/Target/ARM/MCTargetDesc/ARMWinCOFFObjectWriter.cpp [new file with mode: 0644]
lib/Target/ARM/MCTargetDesc/ARMWinCOFFStreamer.cpp [new file with mode: 0644]
lib/Target/ARM/MCTargetDesc/CMakeLists.txt
test/MC/COFF/arm-relocations.s [new file with mode: 0644]