summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMAsmBackend.cpp
diff options
context:
space:
mode:
authorJason W Kim <jason.w.kim.2009@gmail.com>2011-02-04 19:47:15 +0000
committerJason W Kim <jason.w.kim.2009@gmail.com>2011-02-04 19:47:15 +0000
commitd2e2f56c3654a07b42fe1bd47ad3a832ce0d74ea (patch)
treed6806ee94c9b0db07aab09012cc3412213c7be27 /llvm/lib/Target/ARM/ARMAsmBackend.cpp
parent096bd8837fd1e90c10db05af2614c962946a7a8a (diff)
downloadbcm5719-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/Target/ARM/ARMAsmBackend.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMAsmBackend.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/Target/ARM/ARMAsmBackend.cpp b/llvm/lib/Target/ARM/ARMAsmBackend.cpp
index fa8809d5879..ec23449d7d4 100644
--- a/llvm/lib/Target/ARM/ARMAsmBackend.cpp
+++ b/llvm/lib/Target/ARM/ARMAsmBackend.cpp
@@ -67,7 +67,8 @@ public:
{ "fixup_arm_adr_pcrel_12", 1, 24, MCFixupKindInfo::FKF_IsPCRel },
{ "fixup_t2_adr_pcrel_12", 0, 32, MCFixupKindInfo::FKF_IsPCRel |
MCFixupKindInfo::FKF_IsAlignedDownTo32Bits},
-{ "fixup_arm_branch", 0, 24, MCFixupKindInfo::FKF_IsPCRel },
+{ "fixup_arm_condbranch", 0, 24, MCFixupKindInfo::FKF_IsPCRel },
+{ "fixup_arm_uncondbranch", 0, 24, MCFixupKindInfo::FKF_IsPCRel },
{ "fixup_t2_condbranch", 0, 32, MCFixupKindInfo::FKF_IsPCRel },
{ "fixup_t2_uncondbranch", 0, 32, MCFixupKindInfo::FKF_IsPCRel },
{ "fixup_arm_thumb_br", 0, 16, MCFixupKindInfo::FKF_IsPCRel },
@@ -254,7 +255,8 @@ static unsigned adjustFixupValue(unsigned Kind, uint64_t Value) {
return swapped;
}
- case ARM::fixup_arm_branch:
+ case ARM::fixup_arm_condbranch:
+ case ARM::fixup_arm_uncondbranch:
// These values don't encode the low two bits since they're always zero.
// Offset by 8 just as above.
return 0xffffff & ((Value - 8) >> 2);
@@ -454,7 +456,8 @@ static unsigned getFixupKindNumBytes(unsigned Kind) {
case ARM::fixup_arm_ldst_pcrel_12:
case ARM::fixup_arm_pcrel_10:
case ARM::fixup_arm_adr_pcrel_12:
- case ARM::fixup_arm_branch:
+ case ARM::fixup_arm_condbranch:
+ case ARM::fixup_arm_uncondbranch:
return 3;
case FK_Data_4:
OpenPOWER on IntegriCloud