summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2015-01-22 04:03:32 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2015-01-22 04:03:32 +0000
commit10ed0babd301570bbd23cce7b45b5985779e0572 (patch)
treec0b22652d7f884fea48ef878ac3ddb883bb6e435 /llvm/lib/MC
parent1b65dbc4772181dea314782d18717e5397ad2354 (diff)
downloadbcm5719-llvm-10ed0babd301570bbd23cce7b45b5985779e0572.tar.gz
bcm5719-llvm-10ed0babd301570bbd23cce7b45b5985779e0572.zip
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
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r--llvm/lib/MC/WinCOFFObjectWriter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/MC/WinCOFFObjectWriter.cpp b/llvm/lib/MC/WinCOFFObjectWriter.cpp
index d8729bdbc4b..bd750af5de4 100644
--- a/llvm/lib/MC/WinCOFFObjectWriter.cpp
+++ b/llvm/lib/MC/WinCOFFObjectWriter.cpp
@@ -737,8 +737,9 @@ void WinCOFFObjectWriter::RecordRelocation(
++Reloc.Symb->Relocations;
Reloc.Data.VirtualAddress += Fixup.getOffset();
- Reloc.Data.Type = TargetObjectWriter->getRelocType(Target, Fixup,
- CrossSection);
+ Reloc.Data.Type =
+ TargetObjectWriter->getRelocType(Target, Fixup, CrossSection,
+ Asm.getBackend());
// FIXME: Can anyone explain what this does other than adjust for the size
// of the offset?
OpenPOWER on IntegriCloud