Add support for Thumb interworking addresses for symbol offsets that get constant...
authorOwen Anderson <resistor@mac.com>
Mon, 21 Mar 2011 23:13:43 +0000 (23:13 +0000)
committerOwen Anderson <resistor@mac.com>
Mon, 21 Mar 2011 23:13:43 +0000 (23:13 +0000)
This fixes SPASS with -integrated-as.  <rdar://problem/9165399>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128037 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/MCExpr.cpp

index 54d3743e68e42e9906abd1a605c3e77cedf26b34..2debe18bfb2f77e2eb87206426a12ea2c8391642 100644 (file)
@@ -310,6 +310,11 @@ static void AttemptToFoldSymbolOffsetDifference(const MCAssembler *Asm,
   if (AD.getFragment() == BD.getFragment()) {
     Addend += (AD.getOffset() - BD.getOffset());
 
+    // 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;