forked from OSchip/llvm-project
[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. llvm-svn: 263214
This commit is contained in:
parent
0ca63ab544
commit
56e0d53e92
|
@ -315,6 +315,14 @@ void LinkerDriver::createFiles(opt::InputArgList &Args) {
|
|||
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
|
||||
|
|
|
@ -203,14 +203,6 @@ std::unique_ptr<InputFile> Lazy::getMember() {
|
|||
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<ELF32LE>;
|
|||
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>();
|
||||
|
|
|
@ -40,9 +40,6 @@ template <class ELFT> class OutputSection;
|
|||
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.
|
||||
|
|
Loading…
Reference in New Issue