From 6778b53e957a3216a60f30eabcd1a61fb8027e57 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 17 Mar 2019 13:53:42 +0000 Subject: [PATCH] [ELF] De-virtualize findOrphanPos, excludeLibs and handleARMTlsRelocation llvm-svn: 356331 --- lld/ELF/Driver.cpp | 3 +-- lld/ELF/Relocations.cpp | 3 +-- lld/ELF/Writer.cpp | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index 6b1fc8e14b89..c36494debb37 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -1235,7 +1235,6 @@ static DenseSet getExcludeLibs(opt::InputArgList &Args) { // A special library name "ALL" means all archive files. // // This is not a popular option, but some programs such as bionic libc use it. -template static void excludeLibs(opt::InputArgList &Args) { DenseSet Libs = getExcludeLibs(Args); bool All = Libs.count("ALL"); @@ -1555,7 +1554,7 @@ template void LinkerDriver::link(opt::InputArgList &Args) { // Handle the -exclude-libs option. if (Args.hasArg(OPT_exclude_libs)) - excludeLibs(Args); + excludeLibs(Args); // Create ElfHeader early. We need a dummy section in // addReservedSymbols to mark the created symbols as not absolute. diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp index cc8b6e743fc2..ceb9a8b91ccd 100644 --- a/lld/ELF/Relocations.cpp +++ b/lld/ELF/Relocations.cpp @@ -161,7 +161,6 @@ static unsigned handleMipsTlsRelocation(RelType Type, Symbol &Sym, // The pair of GOT entries created are of the form // GOT[e0] Module Index (Used to find pointer to TLS block at run-time) // GOT[e1] Offset of symbol in TLS block -template static unsigned handleARMTlsRelocation(RelType Type, Symbol &Sym, InputSectionBase &C, uint64_t Offset, int64_t Addend, RelExpr Expr) { @@ -214,7 +213,7 @@ handleTlsRelocation(RelType Type, Symbol &Sym, InputSectionBase &C, return 0; if (Config->EMachine == EM_ARM) - return handleARMTlsRelocation(Type, Sym, C, Offset, Addend, Expr); + return handleARMTlsRelocation(Type, Sym, C, Offset, Addend, Expr); if (Config->EMachine == EM_MIPS) return handleMipsTlsRelocation(Type, Sym, C, Offset, Addend, Expr); diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 8b53d378e20c..2fdecaa7e7f8 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -1042,7 +1042,6 @@ static bool shouldSkip(BaseCommand *Cmd) { // We want to place orphan sections so that they share as much // characteristics with their neighbors as possible. For example, if // both are rw, or both are tls. -template static std::vector::iterator findOrphanPos(std::vector::iterator B, std::vector::iterator E) { @@ -1367,7 +1366,7 @@ template void Writer::sortSections() { I = FirstSectionOrDotAssignment; while (NonScriptI != E) { - auto Pos = findOrphanPos(I, NonScriptI); + auto Pos = findOrphanPos(I, NonScriptI); OutputSection *Orphan = cast(*NonScriptI); // As an optimization, find all sections with the same sort rank