[llvm-commits] [llvm] r151345 - /llvm/trunk/lib/MC/MCExpr.cpp

Jim Grosbach grosbach at apple.com
Thu Feb 23 21:12:18 PST 2012


Author: grosbach
Date: Thu Feb 23 23:12:18 2012
New Revision: 151345

URL: http://llvm.org/viewvc/llvm-project?rev=151345&view=rev
Log:
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

Modified:
    llvm/trunk/lib/MC/MCExpr.cpp

Modified: llvm/trunk/lib/MC/MCExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCExpr.cpp?rev=151345&r1=151344&r2=151345&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCExpr.cpp (original)
+++ llvm/trunk/lib/MC/MCExpr.cpp Thu Feb 23 23:12:18 2012
@@ -357,6 +357,11 @@
   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;





More information about the llvm-commits mailing list