Redefine isGnuIfunc as a member function of SymbolBody.
llvm-svn: 263365
diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp
index ed89aad..eee5f3b 100644
--- a/lld/ELF/Target.cpp
+++ b/lld/ELF/Target.cpp
@@ -70,12 +70,6 @@
error("improper alignment for relocation " + S);
}
-template <class ELFT> bool isGnuIFunc(const SymbolBody &S) {
- if (auto *SS = dyn_cast<DefinedElf<ELFT>>(&S))
- return SS->Sym.getType() == STT_GNU_IFUNC;
- return false;
-}
-
namespace {
class X86TargetInfo final : public TargetInfo {
public:
@@ -315,7 +309,7 @@
template <class ELFT>
TargetInfo::PltNeed TargetInfo::needsPlt(uint32_t Type,
const SymbolBody &S) const {
- if (isGnuIFunc<ELFT>(S))
+ if (S.isGnuIfunc<ELFT>())
return Plt_Explicit;
if (canBePreempted(S) && needsPltImpl(Type))
return Plt_Explicit;
@@ -1806,11 +1800,6 @@
return 0;
}
-template bool isGnuIFunc<ELF32LE>(const SymbolBody &S);
-template bool isGnuIFunc<ELF32BE>(const SymbolBody &S);
-template bool isGnuIFunc<ELF64LE>(const SymbolBody &S);
-template bool isGnuIFunc<ELF64BE>(const SymbolBody &S);
-
template uint32_t getMipsGpAddr<ELF32LE>();
template uint32_t getMipsGpAddr<ELF32BE>();
template uint64_t getMipsGpAddr<ELF64LE>();