diff options
author | Fangrui Song <i@maskray.me> | 2023-08-13 08:43:31 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2023-08-13 08:43:31 -0700 |
commit | 65a8448fbf4a8ca3c214f8e514ba86a953d42fb7 (patch) | |
tree | cd2e6fb418c92acfb8537ea7cf3686733b69ec4d /llvm/lib/MC/MCExpr.cpp | |
parent | 91157a0b260b1844914387a135ea4997c21eae00 (diff) | |
download | llvm-65a8448fbf4a8ca3c214f8e514ba86a953d42fb7.zip llvm-65a8448fbf4a8ca3c214f8e514ba86a953d42fb7.tar.gz llvm-65a8448fbf4a8ca3c214f8e514ba86a953d42fb7.tar.bz2 |
Revert "[MC] Remove isThumbFunc special case"
This reverts commit 8ee6c0ea0bf30f1f1da6b49ee720b933f9676a30.
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.
Diffstat (limited to 'llvm/lib/MC/MCExpr.cpp')
-rw-r--r-- | llvm/lib/MC/MCExpr.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCExpr.cpp b/llvm/lib/MC/MCExpr.cpp index 9d08fba..a7b9805 100644 --- a/llvm/lib/MC/MCExpr.cpp +++ b/llvm/lib/MC/MCExpr.cpp @@ -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)) |