diff options
-rw-r--r-- | lld/ELF/Writer.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 1994e24a799..e40a5ce8224 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -69,8 +69,7 @@ private: void scanRelocs(InputSection<ELFT> &C); void scanRelocs(InputSectionBase<ELFT> &S, const Elf_Shdr &RelSec); - RelExpr adjustExpr(const elf::ObjectFile<ELFT> &File, SymbolBody &S, - bool IsWrite, RelExpr Expr, uint32_t Type); + RelExpr adjustExpr(SymbolBody &S, bool IsWrite, RelExpr Expr, uint32_t Type); void createPhdrs(); void assignAddresses(); void assignFileOffsets(); @@ -514,11 +513,8 @@ static RelExpr fromPlt(RelExpr Expr) { } template <class ELFT> -RelExpr Writer<ELFT>::adjustExpr(const elf::ObjectFile<ELFT> &File, - SymbolBody &Body, bool IsWrite, RelExpr Expr, +RelExpr Writer<ELFT>::adjustExpr(SymbolBody &Body, bool IsWrite, RelExpr Expr, uint32_t Type) { - if (Target->needsThunk(Type, File, Body)) - return R_THUNK; bool Preemptible = Body.isPreemptible(); if (Body.isGnuIFunc()) Expr = toPlt(Expr); @@ -618,7 +614,7 @@ void Writer<ELFT>::scanRelocs(InputSectionBase<ELFT> &C, ArrayRef<RelTy> Rels) { continue; bool Preemptible = Body.isPreemptible(); - Expr = adjustExpr(File, Body, IsWrite, Expr, Type); + Expr = adjustExpr(Body, IsWrite, Expr, Type); if (HasError) continue; @@ -683,8 +679,8 @@ void Writer<ELFT>::scanRelocs(InputSectionBase<ELFT> &C, ArrayRef<RelTy> Rels) { continue; } - if (Expr == R_THUNK) { - C.Relocations.push_back({Expr, Type, Offset, Addend, &Body}); + if (Target->needsThunk(Type, File, Body)) { + C.Relocations.push_back({R_THUNK, Type, Offset, Addend, &Body}); continue; } |