[lld] r261932 - Move common code out of target specific hooks.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 25 15:03:56 PST 2016


Author: rafael
Date: Thu Feb 25 17:03:55 2016
New Revision: 261932

URL: http://llvm.org/viewvc/llvm-project?rev=261932&view=rev
Log:
Move common code out of target specific hooks.

Modified:
    lld/trunk/ELF/Target.cpp

Modified: lld/trunk/ELF/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.cpp?rev=261932&r1=261931&r2=261932&view=diff
==============================================================================
--- lld/trunk/ELF/Target.cpp (original)
+++ lld/trunk/ELF/Target.cpp Thu Feb 25 17:03:55 2016
@@ -303,6 +303,8 @@ bool TargetInfo::refersToGotEntry(uint32
 template <class ELFT>
 TargetInfo::PltNeed TargetInfo::needsPlt(uint32_t Type,
                                          const SymbolBody &S) const {
+  if (isGnuIFunc<ELFT>(S))
+    return Plt_Explicit;
   if (needsPltImpl(Type, S))
     return Plt_Explicit;
 
@@ -459,10 +461,7 @@ bool X86TargetInfo::needsGot(uint32_t Ty
 }
 
 bool X86TargetInfo::needsPltImpl(uint32_t Type, const SymbolBody &S) const {
-  if (isGnuIFunc<ELF32LE>(S) ||
-      (Type == R_386_PLT32 && canBePreempted(&S, true)))
-    return true;
-  return false;
+  return Type == R_386_PLT32 && canBePreempted(&S, true);
 }
 
 bool X86TargetInfo::isGotRelative(uint32_t Type) const {
@@ -754,8 +753,6 @@ bool X86_64TargetInfo::isTlsDynRel(unsig
 bool X86_64TargetInfo::needsPltImpl(uint32_t Type, const SymbolBody &S) const {
   if (needsCopyRel<ELF64LE>(Type, S))
     return false;
-  if (isGnuIFunc<ELF64LE>(S))
-    return true;
 
   switch (Type) {
   default:
@@ -1337,8 +1334,6 @@ bool AArch64TargetInfo::needsGot(uint32_
 }
 
 bool AArch64TargetInfo::needsPltImpl(uint32_t Type, const SymbolBody &S) const {
-  if (isGnuIFunc<ELF64LE>(S))
-    return true;
   switch (Type) {
   default:
     return false;




More information about the llvm-commits mailing list