From 99c224787bdc91a9d297f0a68ccdd84334d56087 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 18 Apr 2016 01:34:20 +0000 Subject: [PATCH] Delete the now redundant pointsToLocalDynamicGotEntry. llvm-svn: 266584 --- lld/ELF/Target.cpp | 14 -------------- lld/ELF/Target.h | 1 - lld/ELF/Writer.cpp | 2 +- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp index 5f74717..be61bbc 100644 --- a/lld/ELF/Target.cpp +++ b/lld/ELF/Target.cpp @@ -75,7 +75,6 @@ public: void writeGotPltHeader(uint8_t *Buf) const override; uint32_t getDynRel(uint32_t Type) const override; uint32_t getTlsGotRel(uint32_t Type) const override; - bool pointsToLocalDynamicGotEntry(uint32_t Type) const override; bool isTlsLocalDynamicRel(uint32_t Type) const override; bool isTlsGlobalDynamicRel(uint32_t Type) const override; bool isTlsInitialExecRel(uint32_t Type) const override; @@ -104,7 +103,6 @@ public: RelExpr getRelExpr(uint32_t Type, const SymbolBody &S) const override; uint32_t getDynRel(uint32_t Type) const override; uint32_t getTlsGotRel(uint32_t Type) const override; - bool pointsToLocalDynamicGotEntry(uint32_t Type) const override; bool isTlsLocalDynamicRel(uint32_t Type) const override; bool isTlsGlobalDynamicRel(uint32_t Type) const override; bool isTlsInitialExecRel(uint32_t Type) const override; @@ -323,10 +321,6 @@ bool TargetInfo::needsThunk(uint32_t Type, const InputFile &File, bool TargetInfo::isTlsInitialExecRel(uint32_t Type) const { return false; } -bool TargetInfo::pointsToLocalDynamicGotEntry(uint32_t Type) const { - return false; -} - bool TargetInfo::isTlsLocalDynamicRel(uint32_t Type) const { return false; } bool TargetInfo::isTlsGlobalDynamicRel(uint32_t Type) const { @@ -430,10 +424,6 @@ bool X86TargetInfo::isTlsLocalDynamicRel(uint32_t Type) const { return Type == R_386_TLS_LDO_32 || Type == R_386_TLS_LDM; } -bool X86TargetInfo::pointsToLocalDynamicGotEntry(uint32_t Type) const { - return Type == R_386_TLS_LDM; -} - bool X86TargetInfo::isTlsInitialExecRel(uint32_t Type) const { return Type == R_386_TLS_IE || Type == R_386_TLS_GOTIE; } @@ -765,10 +755,6 @@ bool X86_64TargetInfo::isTlsGlobalDynamicRel(uint32_t Type) const { return Type == R_X86_64_TLSGD; } -bool X86_64TargetInfo::pointsToLocalDynamicGotEntry(uint32_t Type) const { - return Type == R_X86_64_TLSLD; -} - bool X86_64TargetInfo::isTlsLocalDynamicRel(uint32_t Type) const { return Type == R_X86_64_DTPOFF32 || Type == R_X86_64_DTPOFF64 || Type == R_X86_64_TLSLD; diff --git a/lld/ELF/Target.h b/lld/ELF/Target.h index 4d201f2..47b8852 100644 --- a/lld/ELF/Target.h +++ b/lld/ELF/Target.h @@ -25,7 +25,6 @@ class TargetInfo { public: uint64_t getVAStart() const; virtual bool isTlsInitialExecRel(uint32_t Type) const; - virtual bool pointsToLocalDynamicGotEntry(uint32_t Type) const; virtual bool isTlsLocalDynamicRel(uint32_t Type) const; virtual bool isTlsGlobalDynamicRel(uint32_t Type) const; virtual uint32_t getDynRel(uint32_t Type) const { return Type; } diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 1c53e91..325e571b 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -283,7 +283,7 @@ static unsigned handleTlsRelocation(uint32_t Type, SymbolBody &Body, return 0; typedef typename ELFT::uint uintX_t; - if (Target->pointsToLocalDynamicGotEntry(Type)) { + if (Expr == R_TLSLD_PC || Expr == R_TLSLD) { if (Target->canRelaxTls(Type, nullptr)) { C.Relocations.push_back( {R_RELAX_TLS_LD_TO_LE, Type, Offset, Addend, &Body}); -- 2.7.4