[PATCH] D15971: ELF: Remove dead code.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 7 15:35:49 PST 2016


On Jan 7, 2016 2:50 PM, "Rui Ueyama via llvm-commits" <
llvm-commits at lists.llvm.org> wrote:
>
> ruiu created this revision.
> ruiu added a reviewer: grimar.
> ruiu added a subscriber: llvm-commits.
>
> 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
>

lgtm

> Files:
>   ELF/InputSection.cpp
>   ELF/Target.cpp
>   ELF/Target.h
>
> 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<ELF64LE>::Plt->getVA());
>  }
> Index: ELF/InputSection.cpp
> ===================================================================
> --- ELF/InputSection.cpp
> +++ ELF/InputSection.cpp
> @@ -211,7 +211,6 @@
>      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())
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160107/e4504233/attachment.html>


More information about the llvm-commits mailing list