Attempt to get Thumb2 branch fixups working properly.
authorOwen Anderson <resistor@mac.com>
Fri, 10 Dec 2010 23:02:28 +0000 (23:02 +0000)
committerOwen Anderson <resistor@mac.com>
Fri, 10 Dec 2010 23:02:28 +0000 (23:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121593 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMAsmBackend.cpp
lib/Target/ARM/ARMMCCodeEmitter.cpp

index 4555cd2082db9323a6f8de4a6d0484f5de6440d0..e81e454d397b9f4bbb9def7a610160ba1efc77bd 100644 (file)
@@ -141,7 +141,7 @@ static unsigned adjustFixupValue(unsigned Kind, uint64_t Value) {
     // Offset by 8 just as above.
     return 0xffffff & ((Value - 8) >> 2);
   case ARM::fixup_t2_branch: {
-    Value = Value - 6;
+    Value = Value - 4;
     Value >>= 1; // Low bit is not encoded.
     
     uint64_t out = 0;
index 35f2bbd1df783aea7bd200a66ccbd6485e4fc0dc..0bca50eb349af91dd57757eac88eb6363e709c09 100644 (file)
@@ -57,8 +57,7 @@ public:
                                                 MCFixupKindInfo::FKF_IsAligned},
 { "fixup_arm_adr_pcrel_12",  1,            24,  MCFixupKindInfo::FKF_IsPCRel },
 { "fixup_arm_branch",        1,            24,  MCFixupKindInfo::FKF_IsPCRel },
-{ "fixup_t2_branch",         0,            32,  MCFixupKindInfo::FKF_IsPCRel |
-                                                MCFixupKindInfo::FKF_IsAligned},
+{ "fixup_t2_branch",         0,            32,  MCFixupKindInfo::FKF_IsPCRel },
 { "fixup_arm_thumb_br",      0,            16,  MCFixupKindInfo::FKF_IsPCRel },
 { "fixup_arm_thumb_bl",      0,            32,  MCFixupKindInfo::FKF_IsPCRel },
 { "fixup_arm_thumb_blx",     7,            21,  MCFixupKindInfo::FKF_IsPCRel },