diff options
author | Jason W Kim <jason.w.kim.2009@gmail.com> | 2011-02-04 19:47:15 +0000 |
---|---|---|
committer | Jason W Kim <jason.w.kim.2009@gmail.com> | 2011-02-04 19:47:15 +0000 |
commit | d2e2f56c3654a07b42fe1bd47ad3a832ce0d74ea (patch) | |
tree | d6806ee94c9b0db07aab09012cc3412213c7be27 /llvm/lib/MC/ELFObjectWriter.cpp | |
parent | 096bd8837fd1e90c10db05af2614c962946a7a8a (diff) | |
download | bcm5719-llvm-d2e2f56c3654a07b42fe1bd47ad3a832ce0d74ea.tar.gz bcm5719-llvm-d2e2f56c3654a07b42fe1bd47ad3a832ce0d74ea.zip |
Teach ARM/MC/ELF to handle R_ARM_JUMP24 relocation type for conditional jumps.
(yes, this is different from R_ARM_CALL)
- Adds a new method getARMBranchTargetOpValue() which handles the
necessary distinction between the conditional and unconditional br/bl
needed for ARM/ELF
At least for ARM mode, the needed fixup for conditional versus unconditional
br/bl is identical, but the ARM docs and existing ARM tools expect this
reloc type...
Added a few FIXME's for future naming fixups in ARMInstrInfo.td
llvm-svn: 124895
Diffstat (limited to 'llvm/lib/MC/ELFObjectWriter.cpp')
-rw-r--r-- | llvm/lib/MC/ELFObjectWriter.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp index 4dbb5387f3d..629d7468264 100644 --- a/llvm/lib/MC/ELFObjectWriter.cpp +++ b/llvm/lib/MC/ELFObjectWriter.cpp @@ -1503,7 +1503,7 @@ unsigned ARMELFObjectWriter::GetRelocType(const MCValue &Target, break; } break; - case ARM::fixup_arm_branch: + case ARM::fixup_arm_uncondbranch: switch (Modifier) { case MCSymbolRefExpr::VK_ARM_PLT: Type = ELF::R_ARM_PLT32; @@ -1513,6 +1513,9 @@ unsigned ARMELFObjectWriter::GetRelocType(const MCValue &Target, break; } break; + case ARM::fixup_arm_condbranch: + Type = ELF::R_ARM_JUMP24; + break; case ARM::fixup_arm_movt_hi16: case ARM::fixup_arm_movt_hi16_pcrel: Type = ELF::R_ARM_MOVT_PREL; @@ -1565,11 +1568,12 @@ unsigned ARMELFObjectWriter::GetRelocType(const MCValue &Target, case ARM::fixup_arm_thumb_br: assert(0 && "Unimplemented"); break; - case ARM::fixup_arm_branch: - // FIXME: Differentiate between R_ARM_CALL and - // R_ARM_JUMP24 (latter used for conditional jumps) + case ARM::fixup_arm_uncondbranch: Type = ELF::R_ARM_CALL; break; + case ARM::fixup_arm_condbranch: + Type = ELF::R_ARM_JUMP24; + break; case ARM::fixup_arm_movt_hi16: Type = ELF::R_ARM_MOVT_ABS; break; |