[llvm-branch-commits] [NFC][ELF][AArch64] Use existing addSymbolReloc for R_AARCH64_AUTH_ABS64 (PR #171179)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Dec 8 10:31:00 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lld
Author: Jessica Clarke (jrtc27)
<details>
<summary>Changes</summary>
The only difference between these calls is whether rel or type is passed
as the first argument, but AArch64::getDynRel returns type unchanged for
R_AARCH64_AUTH_ABS64, so they are the same.
---
Full diff: https://github.com/llvm/llvm-project/pull/171179.diff
1 Files Affected:
- (modified) lld/ELF/Relocations.cpp (+6-7)
``````````diff
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index e2f68e5688333..ce7ed5a413beb 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -1001,13 +1001,12 @@ void RelocScan::process(RelExpr expr, RelType type, uint64_t offset,
rel = ctx.target->relativeRel;
std::lock_guard<std::mutex> lock(ctx.relocMutex);
Partition &part = sec->getPartition(ctx);
- if (ctx.arg.emachine == EM_AARCH64 && type == R_AARCH64_AUTH_ABS64) {
- // For a preemptible symbol, we can't use a relative relocation. For an
- // undefined symbol, we can't compute offset at link-time and use a
- // relative relocation. Use a symbolic relocation instead.
- if (sym.isPreemptible) {
- part.relaDyn->addSymbolReloc(type, *sec, offset, sym, addend, type);
- } else if (part.relrAuthDyn && sec->addralign >= 2 && offset % 2 == 0) {
+ // For a preemptible symbol, we can't use a relative relocation. For an
+ // undefined symbol, we can't compute offset at link-time and use a
+ // relative relocation. Use a symbolic relocation instead.
+ if (ctx.arg.emachine == EM_AARCH64 && type == R_AARCH64_AUTH_ABS64 &&
+ !sym.isPreemptible) {
+ if (part.relrAuthDyn && sec->addralign >= 2 && offset % 2 == 0) {
// When symbol values are determined in
// finalizeAddressDependentContent, some .relr.auth.dyn relocations
// may be moved to .rela.dyn.
``````````
</details>
https://github.com/llvm/llvm-project/pull/171179
More information about the llvm-branch-commits
mailing list