ARM: fail less catastrophically on invalid Windows input
authorSaleem Abdulrasool <compnerd@compnerd.org>
Thu, 22 Jan 2015 04:03:32 +0000 (04:03 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Thu, 22 Jan 2015 04:03:32 +0000 (04:03 +0000)
commit10ed0babd301570bbd23cce7b45b5985779e0572
treec0b22652d7f884fea48ef878ac3ddb883bb6e435
parent1b65dbc4772181dea314782d18717e5397ad2354
ARM: fail less catastrophically on invalid Windows input

Windows supports a restricted set of relocations (compared to ARM ELF).  In some
cases, we may end up generating an unsupported relocation.  This can occur with
bad input to the assembler in particular (the frontend should never generate
code that cannot be compiled).  Generate an error rather than just aborting.

The change in the API is driven by the desire to provide a slightly more helpful
message for debugging purposes.

llvm-svn: 226779
llvm/include/llvm/MC/MCWinCOFFObjectWriter.h
llvm/lib/MC/WinCOFFObjectWriter.cpp
llvm/lib/Target/ARM/MCTargetDesc/ARMWinCOFFObjectWriter.cpp
llvm/lib/Target/X86/MCTargetDesc/X86WinCOFFObjectWriter.cpp
llvm/test/MC/ARM/Windows/invalid-relocation.s [new file with mode: 0644]