diff options
| author | Rui Ueyama <ruiu@google.com> | 2016-01-08 20:11:47 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2016-01-08 20:11:47 +0000 |
| commit | b705b100127b0fec09f2219381d8428914773a27 (patch) | |
| tree | b68dae05a68fe4f6ae2a93b03468a4fe84680fdb | |
| parent | cfe331042a7a26b8e141da0d937400bb04926393 (diff) | |
| download | bcm5719-llvm-b705b100127b0fec09f2219381d8428914773a27.tar.gz bcm5719-llvm-b705b100127b0fec09f2219381d8428914773a27.zip | |
ELF: Remove dead code.
R_X86_64_PLT32 is handled in the same way as R_X86_64_PC32 by
relocateOne(), so this function does not seems to be needed.
Without this code, all tests still pass.
http://reviews.llvm.org/D15971
llvm-svn: 257203
| -rw-r--r-- | lld/ELF/InputSection.cpp | 1 | ||||
| -rw-r--r-- | lld/ELF/Target.cpp | 12 | ||||
| -rw-r--r-- | lld/ELF/Target.h | 1 |
3 files changed, 0 insertions, 14 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index 3e949ffc555..f6aa51b47b9 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -211,7 +211,6 @@ void InputSectionBase<ELFT>::relocate(uint8_t *Buf, uint8_t *BufEnd, uintX_t SymVA = getSymVA<ELFT>(*Body); if (Target->relocNeedsPlt(Type, *Body)) { SymVA = Out<ELFT>::Plt->getEntryAddr(*Body); - Type = Target->getPltRefReloc(Type); } else if (Target->relocNeedsGot(Type, *Body)) { SymVA = Out<ELFT>::Got->getEntryAddr(*Body); if (Body->isTls()) diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp index 6db1f9044ac..3592120fa4b 100644 --- a/lld/ELF/Target.cpp +++ b/lld/ELF/Target.cpp @@ -122,7 +122,6 @@ private: 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 @@ class AArch64TargetInfo final : public TargetInfo { 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::needsCopyRel(uint32_t Type, const SymbolBody &S) const { 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::isSizeReloc(uint32_t Type) const { return false; } @@ -655,12 +651,6 @@ bool X86_64TargetInfo::isTlsDynReloc(unsigned Type, const SymbolBody &S) const { 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; @@ -1151,8 +1141,6 @@ unsigned AArch64TargetInfo::getDynReloc(unsigned Type) const { "recompile with -fPIC."); } -unsigned AArch64TargetInfo::getPltRefReloc(unsigned Type) const { return Type; } - void AArch64TargetInfo::writeGotPltEntry(uint8_t *Buf, uint64_t Plt) const { write64le(Buf, Out<ELF64LE>::Plt->getVA()); } diff --git a/lld/ELF/Target.h b/lld/ELF/Target.h index 06c54e63d26..e9c5f4b31ae 100644 --- a/lld/ELF/Target.h +++ b/lld/ELF/Target.h @@ -45,7 +45,6 @@ public: 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; } |

