Skip to content

Commit 9746286

Browse files
committed
Add support for Thumb interworking addresses for symbol offsets that get constant folded very early.
This fixes SPASS with -integrated-as. <rdar://problem/9165399> llvm-svn: 128037
1 parent dddce99 commit 9746286

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llvm/lib/MC/MCExpr.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,11 @@ static void AttemptToFoldSymbolOffsetDifference(const MCAssembler *Asm,
310310
if (AD.getFragment() == BD.getFragment()) {
311311
Addend += (AD.getOffset() - BD.getOffset());
312312

313+
// Pointers to Thumb symbols need to have their low-bit set to allow
314+
// for interworking.
315+
if (Asm->isThumbFunc(&SA))
316+
Addend |= 1;
317+
313318
// Clear the symbol expr pointers to indicate we have folded these
314319
// operands.
315320
A = B = 0;

0 commit comments

Comments
 (0)