Skip to content

Commit

Permalink
Revert "[MC] Remove isThumbFunc special case"
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
MaskRay committed Aug 13, 2023
1 parent 91157a0 commit 65a8448
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions llvm/lib/MC/MCExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,11 @@ static void AttemptToFoldSymbolOffsetDifference(
return;

auto FinalizeFolding = [&]() {
// Pointers to Thumb symbols need to have their low-bit set to allow
// for interworking.
if (Asm->isThumbFunc(&SA))
Addend |= 1;

// If symbol is labeled as micromips, we set low-bit to ensure
// correct offset in .gcc_except_table
if (Asm->getBackend().isMicroMips(&SA))
Expand Down

0 comments on commit 65a8448

Please sign in to comment.