diff --git a/lib/MC/MCExpr.cpp b/lib/MC/MCExpr.cpp index f3a91cbd5ef..ceaecd04103 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;