aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC/MCExpr.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2012-02-24 05:12:18 +0000
committerJim Grosbach <grosbach@apple.com>2012-02-24 05:12:18 +0000
commit0db1241416f2ca5fe8e81c60204025b585c45c0f (patch)
tree7c2b21702037da8b29099f2a074ffaa57c492e64 /lib/MC/MCExpr.cpp
parentd18134f11621c2ff4d2bde6effb9c7115944f9fe (diff)
downloadexternal_llvm-0db1241416f2ca5fe8e81c60204025b585c45c0f.zip
external_llvm-0db1241416f2ca5fe8e81c60204025b585c45c0f.tar.gz
external_llvm-0db1241416f2ca5fe8e81c60204025b585c45c0f.tar.bz2
ARM Thumb symbol references in assembly need the low bit set.
Add support for a missed case when the symbols in a difference expression are in the same section but not the same fragment. rdar://10924681 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151345 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCExpr.cpp')
-rw-r--r--lib/MC/MCExpr.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/MC/MCExpr.cpp b/lib/MC/MCExpr.cpp
index f3a91cb..ceaecd0 100644
--- a/lib/MC/MCExpr.cpp
+++ b/lib/MC/MCExpr.cpp
@@ -357,6 +357,11 @@ static void AttemptToFoldSymbolOffsetDifference(const MCAssembler *Asm,
if (Addrs && (&SecA != &SecB))
Addend += (Addrs->lookup(&SecA) - Addrs->lookup(&SecB));
+ // Pointers to Thumb symbols need to have their low-bit set to allow
+ // for interworking.
+ if (Asm->isThumbFunc(&SA))
+ Addend |= 1;
+
// Clear the symbol expr pointers to indicate we have folded these
// operands.
A = B = 0;