[PATCH] D32355: [ELF] - Remove dead TLS relocations relative code for MIPS and ARM

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 21 08:40:26 PDT 2017


grimar created this revision.
Herald added subscribers: arichardson, rengolin, aemerson.

Found that this code not used because of
handleARMTlsRelocation and handleMipsTlsRelocation methods that are called
for these platforms intead regular TLS code.

So, it is dead code that we can remove I think, or do we need it for some reason ?


https://reviews.llvm.org/D32355

Files:
  ELF/Target.cpp


Index: ELF/Target.cpp
===================================================================
--- ELF/Target.cpp
+++ ELF/Target.cpp
@@ -223,8 +223,6 @@
   bool isPicRel(uint32_t Type) const override;
   uint32_t getDynRel(uint32_t Type) const override;
   int64_t getImplicitAddend(const uint8_t *Buf, uint32_t Type) const override;
-  bool isTlsLocalDynamicRel(uint32_t Type) const override;
-  bool isTlsInitialExecRel(uint32_t Type) const override;
   void writeGotPlt(uint8_t *Buf, const SymbolBody &S) const override;
   void writeIgotPlt(uint8_t *Buf, const SymbolBody &S) const override;
   void writePltHeader(uint8_t *Buf) const override;
@@ -245,7 +243,6 @@
   int64_t getImplicitAddend(const uint8_t *Buf, uint32_t Type) const override;
   bool isPicRel(uint32_t Type) const override;
   uint32_t getDynRel(uint32_t Type) const override;
-  bool isTlsLocalDynamicRel(uint32_t Type) const override;
   void writeGotPlt(uint8_t *Buf, const SymbolBody &S) const override;
   void writePltHeader(uint8_t *Buf) const override;
   void writePlt(uint8_t *Buf, uint64_t GotPltEntryAddr, uint64_t PltEntryAddr,
@@ -2065,14 +2062,6 @@
   }
 }
 
-bool ARMTargetInfo::isTlsLocalDynamicRel(uint32_t Type) const {
-  return Type == R_ARM_TLS_LDO32 || Type == R_ARM_TLS_LDM32;
-}
-
-bool ARMTargetInfo::isTlsInitialExecRel(uint32_t Type) const {
-  return Type == R_ARM_TLS_IE32;
-}
-
 template <class ELFT> MipsTargetInfo<ELFT>::MipsTargetInfo() {
   GotPltHeaderEntriesNum = 2;
   DefaultMaxPageSize = 65536;
@@ -2165,11 +2154,6 @@
 }
 
 template <class ELFT>
-bool MipsTargetInfo<ELFT>::isTlsLocalDynamicRel(uint32_t Type) const {
-  return Type == R_MIPS_TLS_LDM;
-}
-
-template <class ELFT>
 void MipsTargetInfo<ELFT>::writeGotPlt(uint8_t *Buf, const SymbolBody &) const {
   write32<ELFT::TargetEndianness>(Buf, In<ELFT>::Plt->getVA());
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32355.96148.patch
Type: text/x-patch
Size: 1838 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170421/9b858bbf/attachment.bin>


More information about the llvm-commits mailing list