aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/ARM/ARMAsmBackend.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2010-12-08 00:18:36 +0000
committerOwen Anderson <resistor@mac.com>2010-12-08 00:18:36 +0000
commitd8e351b96f5fd7007fbdd636acaa1fc9f6e18f3c (patch)
tree0c76b83a6946f82c9a16aff12aad8823ae11c93a /lib/Target/ARM/ARMAsmBackend.cpp
parente113ae56d9ee2fddce14f5caaae1229e70ee0a00 (diff)
VLDR fixups need special handling under Thumb. While the encoding is the same,
the order of the bytes in the data stream is flipped around. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121215 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMAsmBackend.cpp')
-rw-r--r--lib/Target/ARM/ARMAsmBackend.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Target/ARM/ARMAsmBackend.cpp b/lib/Target/ARM/ARMAsmBackend.cpp
index 96a5548134..7c4823d8ba 100644
--- a/lib/Target/ARM/ARMAsmBackend.cpp
+++ b/lib/Target/ARM/ARMAsmBackend.cpp
@@ -115,6 +115,7 @@ static unsigned adjustFixupValue(unsigned Kind, uint64_t Value) {
Binary = ((Binary & 0x7ff) << 16) | (Binary >> 11);
return Binary;
}
+ case ARM::fixup_t2_pcrel_10:
case ARM::fixup_arm_pcrel_10: {
// Offset by 8 just as above.
Value = Value - 8;
@@ -127,6 +128,16 @@ static unsigned adjustFixupValue(unsigned Kind, uint64_t Value) {
Value >>= 2;
assert ((Value < 256) && "Out of range pc-relative fixup value!");
Value |= isAdd << 23;
+
+ // Same addressing mode as fixup_arm_pcrel_10, but with the bytes reordered.
+ if (Kind == ARM::fixup_t2_pcrel_10) {
+ uint64_t swapped = (Value & 0x00FF0000) >> 16;
+ swapped |= (Value & 0xFF000000) >> 16;
+ swapped |= (Value & 0x000000FF) << 16;
+ swapped |= (Value & 0x0000FF00) << 16;
+ return swapped;
+ }
+
return Value;
}
}
@@ -218,6 +229,7 @@ static unsigned getFixupKindNumBytes(unsigned Kind) {
case ARM::fixup_arm_adr_pcrel_12:
case ARM::fixup_arm_branch:
return 3;
+ case ARM::fixup_t2_pcrel_10:
case ARM::fixup_arm_thumb_bl:
return 4;
}