Skip to content

Commit 65a8448

Browse files
committed
Revert "[MC] Remove isThumbFunc special case"
This reverts commit 8ee6c0e. The untested special case is used as a workaround that we don't force emitting R_ARM_REL32 relocations like GNU assembler's arm port: `TC_FORCE_RELOCATION_SUB_SAME`. We shall investigate how to emit R_ARM_REL32.
1 parent 91157a0 commit 65a8448

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
@@ -606,6 +606,11 @@ static void AttemptToFoldSymbolOffsetDifference(
606606
return;
607607

608608
auto FinalizeFolding = [&]() {
609+
// Pointers to Thumb symbols need to have their low-bit set to allow
610+
// for interworking.
611+
if (Asm->isThumbFunc(&SA))
612+
Addend |= 1;
613+
609614
// If symbol is labeled as micromips, we set low-bit to ensure
610615
// correct offset in .gcc_except_table
611616
if (Asm->getBackend().isMicroMips(&SA))

0 commit comments

Comments
 (0)