Index: ELF/InputSection.cpp =================================================================== --- ELF/InputSection.cpp +++ ELF/InputSection.cpp @@ -211,7 +211,6 @@ uintX_t SymVA = getSymVA(*Body); if (Target->relocNeedsPlt(Type, *Body)) { SymVA = Out::Plt->getEntryAddr(*Body); - Type = Target->getPltRefReloc(Type); } else if (Target->relocNeedsGot(Type, *Body)) { SymVA = Out::Got->getEntryAddr(*Body); if (Body->isTls()) Index: ELF/Target.h =================================================================== --- ELF/Target.h +++ ELF/Target.h @@ -45,7 +45,6 @@ virtual bool isTlsDynReloc(unsigned Type, const SymbolBody &S) const { return false; } - virtual unsigned getPltRefReloc(unsigned Type) const; virtual unsigned getTlsGotReloc(unsigned Type = -1) const { return TlsGotReloc; } Index: ELF/Target.cpp =================================================================== --- ELF/Target.cpp +++ ELF/Target.cpp @@ -122,7 +122,6 @@ class X86_64TargetInfo final : public TargetInfo { public: X86_64TargetInfo(); - unsigned getPltRefReloc(unsigned Type) const override; bool isTlsDynReloc(unsigned Type, const SymbolBody &S) const override; void writeGotPltHeaderEntries(uint8_t *Buf) const override; void writeGotPltEntry(uint8_t *Buf, uint64_t Plt) const override; @@ -176,7 +175,6 @@ public: AArch64TargetInfo(); unsigned getDynReloc(unsigned Type) const override; - unsigned getPltRefReloc(unsigned Type) const override; void writeGotPltEntry(uint8_t *Buf, uint64_t Plt) const override; void writePltZeroEntry(uint8_t *Buf, uint64_t GotEntryAddr, uint64_t PltEntryAddr) const override; @@ -265,8 +263,6 @@ bool TargetInfo::isGotRelative(uint32_t Type) const { return false; } -unsigned TargetInfo::getPltRefReloc(unsigned Type) const { return PCRelReloc; } - bool TargetInfo::isRelRelative(uint32_t Type) const { return true; } bool TargetInfo::isSizeDynReloc(uint32_t Type, const SymbolBody &S) const { @@ -657,12 +653,6 @@ return Type == R_X86_64_GOTTPOFF || Type == R_X86_64_TLSGD; } -unsigned X86_64TargetInfo::getPltRefReloc(unsigned Type) const { - if (Type == R_X86_64_PLT32) - return R_X86_64_PC32; - return Type; -} - bool X86_64TargetInfo::relocNeedsPlt(uint32_t Type, const SymbolBody &S) const { if (needsCopyRel(Type, S)) return false; @@ -1157,8 +1147,6 @@ "recompile with -fPIC."); } -unsigned AArch64TargetInfo::getPltRefReloc(unsigned Type) const { return Type; } - void AArch64TargetInfo::writeGotPltEntry(uint8_t *Buf, uint64_t Plt) const { write64le(Buf, Out::Plt->getVA()); }