aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/ARM/ARMAsmBackend.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2010-12-09 20:27:52 +0000
committerOwen Anderson <resistor@mac.com>2010-12-09 20:27:52 +0000
commit05018c2f2872a05b1a2fff1a9934621ba1f38084 (patch)
treed50bd3b2f96ee8493415aaaa65483807f5bd3013 /lib/Target/ARM/ARMAsmBackend.cpp
parentb492a7c2134d3886f545f1b5ea55115d71529a10 (diff)
downloadexternal_llvm-05018c2f2872a05b1a2fff1a9934621ba1f38084.zip
external_llvm-05018c2f2872a05b1a2fff1a9934621ba1f38084.tar.gz
external_llvm-05018c2f2872a05b1a2fff1a9934621ba1f38084.tar.bz2
Fix an issue in some Thumb fixups, where the effective PC address needs to be 4-byte aligned when calculating
the offset. Add a new fixup flag to represent this, and use it for the one fixups that I have a testcase for needing this. It's quite likely that the other Thumb fixups will need this too, and to have their fixup encoding logic adjusted accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121408 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMAsmBackend.cpp')
-rw-r--r--lib/Target/ARM/ARMAsmBackend.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Target/ARM/ARMAsmBackend.cpp b/lib/Target/ARM/ARMAsmBackend.cpp
index 6be9f92..606437e 100644
--- a/lib/Target/ARM/ARMAsmBackend.cpp
+++ b/lib/Target/ARM/ARMAsmBackend.cpp
@@ -100,10 +100,10 @@ static unsigned adjustFixupValue(unsigned Kind, uint64_t Value) {
}
case ARM::fixup_arm_ldst_pcrel_12:
// ARM PC-relative values are offset by 8.
- Value -= 6;
+ Value -= 4;
case ARM::fixup_t2_ldst_pcrel_12: {
// Offset by 4, adjusted by two due to the half-word ordering of thumb.
- Value -= 2;
+ Value -= 4;
bool isAdd = true;
if ((int64_t)Value < 0) {
Value = -Value;