[lld] r339553 - [LLD][ELF] - Remove dead code from handleTlsRelocation. NFC.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 13 04:20:18 PDT 2018


Author: grimar
Date: Mon Aug 13 04:20:18 2018
New Revision: 339553

URL: http://llvm.org/viewvc/llvm-project?rev=339553&view=rev
Log:
[LLD][ELF] - Remove dead code from handleTlsRelocation. NFC.

That piece of code is really very old and "protected"
from TLS relocations against symbol in non-allocatable sections.
It is useless because normally non-alloc sections have relocations
with allocatable targets, but not the reverse.
And so the code was simply dead.

Modified:
    lld/trunk/ELF/Relocations.cpp

Modified: lld/trunk/ELF/Relocations.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Relocations.cpp?rev=339553&r1=339552&r2=339553&view=diff
==============================================================================
--- lld/trunk/ELF/Relocations.cpp (original)
+++ lld/trunk/ELF/Relocations.cpp Mon Aug 13 04:20:18 2018
@@ -165,9 +165,6 @@ template <class ELFT>
 static unsigned
 handleTlsRelocation(RelType Type, Symbol &Sym, InputSectionBase &C,
                     typename ELFT::uint Offset, int64_t Addend, RelExpr Expr) {
-  if (!(C.Flags & SHF_ALLOC))
-    return 0;
-
   if (!Sym.isTls())
     return 0;
 




More information about the llvm-commits mailing list