From: Jim Grosbach Date: Wed, 18 Jan 2012 00:40:25 +0000 (+0000) Subject: Thumb2 load/store fixups don't set the thumb bit. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=5a7efa7f134dd6f8f927c162d9f4062eaa3eb4ac;p=oota-llvm.git 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148366 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp b/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp index 88fea5745d8..0e10b643c5f 100644 --- a/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp +++ b/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp @@ -109,10 +109,14 @@ public: 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; + } } }