aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/ARM/ARMAsmBackend.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2010-12-15 08:51:02 +0000
committerBill Wendling <isanbard@gmail.com>2010-12-15 08:51:02 +0000
commit22447ae54bcb8ca94ed994cad103074a24e66781 (patch)
treee4c77d51680625c5ceb7f1b9c604c2fe926c6381 /lib/Target/ARM/ARMAsmBackend.cpp
parent2bf6afc277edb32b1d940def5b3eb0e0d32a22b9 (diff)
Add fixups for Thumb LDR/STR instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121858 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMAsmBackend.cpp')
-rw-r--r--lib/Target/ARM/ARMAsmBackend.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Target/ARM/ARMAsmBackend.cpp b/lib/Target/ARM/ARMAsmBackend.cpp
index e4acd66730..67f2c71057 100644
--- a/lib/Target/ARM/ARMAsmBackend.cpp
+++ b/lib/Target/ARM/ARMAsmBackend.cpp
@@ -237,6 +237,9 @@ static unsigned adjustFixupValue(unsigned Kind, uint64_t Value) {
// 'off by 4' is implicitly handled by the half-word ordering of the
// Thumb encoding, so we only need to adjust by 2 here.
return ((Value - 2) >> 2) & 0xff;
+ case ARM::fixup_arm_thumb_ldst:
+ // Offset by 4.
+ return ((Value - 4) & 0x1f) << 6;
case ARM::fixup_arm_thumb_cb: {
// Offset by 4 and don't encode the lower bit, which is always 0.
uint32_t Binary = (Value - 4) >> 1;
@@ -365,6 +368,7 @@ static unsigned getFixupKindNumBytes(unsigned Kind) {
case ARM::fixup_arm_thumb_br:
case ARM::fixup_arm_thumb_cb:
+ case ARM::fixup_arm_thumb_ldst:
return 2;
case ARM::fixup_arm_ldst_pcrel_12: