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 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.