[llvm-commits] [llvm] r148366 - /llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp

Jim Grosbach grosbach at apple.com
Tue Jan 17 16:40:25 PST 2012


Author: grosbach
Date: Tue Jan 17 18:40:25 2012
New Revision: 148366

URL: http://llvm.org/viewvc/llvm-project?rev=148366&view=rev
Log:
Thumb2 load/store fixups don't set the thumb bit.

Load/store instructions w/ a fixup to be relative a function marked as thumb
don't use the low bit to specify thumb vs. non-thumb like interworking
branches do, so don't set it when dealing with those fixups.

rdar://10348687.

Modified:
    llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp

Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp?rev=148366&r1=148365&r2=148366&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp Tue Jan 17 18:40:25 2012
@@ -109,10 +109,14 @@
                          MCValue &Target, uint64_t &Value) {
     // Some fixups to thumb function symbols need the low bit (thumb bit)
     // twiddled.
-    if (const MCSymbolRefExpr *A = Target.getSymA()) {
-      const MCSymbol &Sym = A->getSymbol().AliasedSymbol();
-      if (Asm.isThumbFunc(&Sym))
-        Value |= 1;
+    if ((unsigned)Fixup.getKind() != ARM::fixup_arm_ldst_pcrel_12 &&
+        (unsigned)Fixup.getKind() != ARM::fixup_t2_ldst_pcrel_12 &&
+        (unsigned)Fixup.getKind() != ARM::fixup_arm_thumb_cp) {
+      if (const MCSymbolRefExpr *A = Target.getSymA()) {
+        const MCSymbol &Sym = A->getSymbol().AliasedSymbol();
+        if (Asm.isThumbFunc(&Sym))
+          Value |= 1;
+      }
     }
   }
 





More information about the llvm-commits mailing list