diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index c27ab2b67dc2b2..7d26fa9aea74ab 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -1639,14 +1639,14 @@ void RelocationBaseSection::addSymbolReloc( } void RelocationBaseSection::addAddendOnlyRelocIfNonPreemptible( - RelType dynType, GotSection &sec, uint64_t offsetInSec, Symbol &sym, + RelType dynType, InputSectionBase &isec, uint64_t offsetInSec, Symbol &sym, RelType addendRelType) { // No need to write an addend to the section for preemptible symbols. if (sym.isPreemptible) - addReloc({dynType, &sec, offsetInSec, DynamicReloc::AgainstSymbol, sym, 0, + addReloc({dynType, &isec, offsetInSec, DynamicReloc::AgainstSymbol, sym, 0, R_ABS}); else - addReloc(DynamicReloc::AddendOnlyWithTargetVA, dynType, sec, offsetInSec, + addReloc(DynamicReloc::AddendOnlyWithTargetVA, dynType, isec, offsetInSec, sym, 0, R_ABS, addendRelType); } diff --git a/lld/ELF/SyntheticSections.h b/lld/ELF/SyntheticSections.h index d4169e1e1acaf6..43eb82cbb3e28b 100644 --- a/lld/ELF/SyntheticSections.h +++ b/lld/ELF/SyntheticSections.h @@ -523,7 +523,8 @@ class RelocationBaseSection : public SyntheticSection { } /// Add a dynamic relocation using the target address of \p sym as the addend /// if \p sym is non-preemptible. Otherwise add a relocation against \p sym. - void addAddendOnlyRelocIfNonPreemptible(RelType dynType, GotSection &sec, + void addAddendOnlyRelocIfNonPreemptible(RelType dynType, + InputSectionBase &isec, uint64_t offsetInSec, Symbol &sym, RelType addendRelType); template