[lld] r263214 - [ELF] - Move initSymbols() to Driver.cpp. NFC.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 11 02:07:19 PST 2016


Author: grimar
Date: Fri Mar 11 04:07:18 2016
New Revision: 263214

URL: http://llvm.org/viewvc/llvm-project?rev=263214&view=rev
Log:
[ELF] - Move initSymbols() to Driver.cpp. NFC.

That is followup for http://reviews.llvm.org/D18047
patch. initSymbols() moved to Driver.cpp and made static.

Modified:
    lld/trunk/ELF/Driver.cpp
    lld/trunk/ELF/Symbols.cpp
    lld/trunk/ELF/Symbols.h

Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=263214&r1=263213&r2=263214&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Fri Mar 11 04:07:18 2016
@@ -315,6 +315,14 @@ void LinkerDriver::createFiles(opt::Inpu
     error("No input files");
 }
 
+template <class ELFT> static void initSymbols() {
+  ElfSym<ELFT>::Etext.setBinding(STB_GLOBAL);
+  ElfSym<ELFT>::Edata.setBinding(STB_GLOBAL);
+  ElfSym<ELFT>::End.setBinding(STB_GLOBAL);
+  ElfSym<ELFT>::Ignored.setBinding(STB_WEAK);
+  ElfSym<ELFT>::Ignored.setVisibility(STV_HIDDEN);
+}
+
 template <class ELFT> void LinkerDriver::link(opt::InputArgList &Args) {
   initSymbols<ELFT>();
   // For LTO

Modified: lld/trunk/ELF/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.cpp?rev=263214&r1=263213&r2=263214&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.cpp (original)
+++ lld/trunk/ELF/Symbols.cpp Fri Mar 11 04:07:18 2016
@@ -203,14 +203,6 @@ std::unique_ptr<InputFile> Lazy::getMemb
   return createObjectFile(MBRef, File->getName());
 }
 
-template <class ELFT> void elf::initSymbols() {
-  ElfSym<ELFT>::Etext.setBinding(STB_GLOBAL);
-  ElfSym<ELFT>::Edata.setBinding(STB_GLOBAL);
-  ElfSym<ELFT>::End.setBinding(STB_GLOBAL);
-  ElfSym<ELFT>::Ignored.setBinding(STB_WEAK);
-  ElfSym<ELFT>::Ignored.setVisibility(STV_HIDDEN);
-}
-
 // Returns the demangled C++ symbol name for Name.
 std::string elf::demangle(StringRef Name) {
 #if !defined(HAVE_CXXABI_H)
@@ -276,8 +268,3 @@ template class elf::DefinedSynthetic<ELF
 template class elf::DefinedSynthetic<ELF32BE>;
 template class elf::DefinedSynthetic<ELF64LE>;
 template class elf::DefinedSynthetic<ELF64BE>;
-
-template void elf::initSymbols<ELF32LE>();
-template void elf::initSymbols<ELF32BE>();
-template void elf::initSymbols<ELF64LE>();
-template void elf::initSymbols<ELF64BE>();

Modified: lld/trunk/ELF/Symbols.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.h?rev=263214&r1=263213&r2=263214&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.h (original)
+++ lld/trunk/ELF/Symbols.h Fri Mar 11 04:07:18 2016
@@ -40,9 +40,6 @@ template <class ELFT> class OutputSectio
 template <class ELFT> class OutputSectionBase;
 template <class ELFT> class SharedFile;
 
-// Initializes global objects defined in this file.
-template <class ELFT> void initSymbols();
-
 // Returns a demangled C++ symbol name. If Name is not a mangled
 // name or the system does not provide __cxa_demangle function,
 // it returns the unmodified string.




More information about the llvm-commits mailing list