diff options
-rw-r--r-- | lld/ELF/Driver.cpp | 6 | ||||
-rw-r--r-- | lld/ELF/DriverUtils.cpp | 10 | ||||
-rw-r--r-- | lld/ELF/LinkerScript.cpp | 2 | ||||
-rw-r--r-- | lld/ELF/MarkLive.cpp | 10 | ||||
-rw-r--r-- | lld/ELF/OutputSections.cpp | 17 | ||||
-rw-r--r-- | lld/ELF/Symbols.cpp | 18 | ||||
-rw-r--r-- | lld/ELF/Writer.cpp | 10 |
7 files changed, 36 insertions, 37 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index 2a3ecfa6158..94b2ab48b61 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -26,10 +26,10 @@ using namespace llvm::object; using namespace lld; using namespace lld::elf2; -Configuration *lld::elf2::Config; -LinkerDriver *lld::elf2::Driver; +Configuration *elf2::Config; +LinkerDriver *elf2::Driver; -void lld::elf2::link(ArrayRef<const char *> Args) { +void elf2::link(ArrayRef<const char *> Args) { Configuration C; LinkerDriver D; Config = &C; diff --git a/lld/ELF/DriverUtils.cpp b/lld/ELF/DriverUtils.cpp index 51b500bebf4..965ed4f00a6 100644 --- a/lld/ELF/DriverUtils.cpp +++ b/lld/ELF/DriverUtils.cpp @@ -51,8 +51,8 @@ public: }; // Parses a given list of options. -opt::InputArgList lld::elf2::parseArgs(llvm::BumpPtrAllocator *A, - ArrayRef<const char *> Argv) { +opt::InputArgList elf2::parseArgs(llvm::BumpPtrAllocator *A, + ArrayRef<const char *> Argv) { // Make InputArgList from string vectors. ELFOptTable Table; unsigned MissingIndex; @@ -79,7 +79,7 @@ opt::InputArgList lld::elf2::parseArgs(llvm::BumpPtrAllocator *A, return Args; } -std::string lld::elf2::findFromSearchPaths(StringRef Path) { +std::string elf2::findFromSearchPaths(StringRef Path) { for (StringRef Dir : Config->SearchPaths) { std::string FullPath = buildSysrootedPath(Dir, Path); if (sys::fs::exists(FullPath)) @@ -90,7 +90,7 @@ std::string lld::elf2::findFromSearchPaths(StringRef Path) { // Searches a given library from input search paths, which are filled // from -L command line switches. Returns a path to an existent library file. -std::string lld::elf2::searchLibrary(StringRef Path) { +std::string elf2::searchLibrary(StringRef Path) { std::vector<std::string> Names; if (Path[0] == ':') { Names.push_back(Path.drop_front()); @@ -110,7 +110,7 @@ std::string lld::elf2::searchLibrary(StringRef Path) { // Makes a path by concatenating Dir and File. // If Dir starts with '=' the result will be preceded by Sysroot, // which can be set with --sysroot command line switch. -std::string lld::elf2::buildSysrootedPath(StringRef Dir, StringRef File) { +std::string elf2::buildSysrootedPath(StringRef Dir, StringRef File) { SmallString<128> Path; if (Dir.startswith("=")) sys::path::append(Path, Config->Sysroot, Dir.substr(1), File); diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 883b623f9e2..a6df9ed48cd 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -312,7 +312,7 @@ static bool isUnderSysroot(StringRef Path) { } // Entry point. The other functions or classes are private to this file. -void lld::elf2::readLinkerScript(BumpPtrAllocator *A, MemoryBufferRef MB) { +void elf2::readLinkerScript(BumpPtrAllocator *A, MemoryBufferRef MB) { StringRef Path = MB.getBufferIdentifier(); LinkerScript(A, MB.getBuffer(), isUnderSysroot(Path)).run(); } diff --git a/lld/ELF/MarkLive.cpp b/lld/ELF/MarkLive.cpp index b719b1a09c2..02b9879b115 100644 --- a/lld/ELF/MarkLive.cpp +++ b/lld/ELF/MarkLive.cpp @@ -79,7 +79,7 @@ template <class ELFT> static bool isReserved(InputSectionBase<ELFT> *Sec) { // This is the main function of the garbage collector. // Starting from GC-root sections, this function visits all reachable // sections to set their "Live" bits. -template <class ELFT> void lld::elf2::markLive(SymbolTable<ELFT> *Symtab) { +template <class ELFT> void elf2::markLive(SymbolTable<ELFT> *Symtab) { SmallVector<InputSection<ELFT> *, 256> Q; auto Enqueue = [&](InputSectionBase<ELFT> *Sec) { @@ -125,7 +125,7 @@ template <class ELFT> void lld::elf2::markLive(SymbolTable<ELFT> *Symtab) { forEachSuccessor<ELFT>(Q.pop_back_val(), Enqueue); } -template void lld::elf2::markLive<ELF32LE>(SymbolTable<ELF32LE> *); -template void lld::elf2::markLive<ELF32BE>(SymbolTable<ELF32BE> *); -template void lld::elf2::markLive<ELF64LE>(SymbolTable<ELF64LE> *); -template void lld::elf2::markLive<ELF64BE>(SymbolTable<ELF64BE> *); +template void elf2::markLive<ELF32LE>(SymbolTable<ELF32LE> *); +template void elf2::markLive<ELF32BE>(SymbolTable<ELF32BE> *); +template void elf2::markLive<ELF64LE>(SymbolTable<ELF64LE> *); +template void elf2::markLive<ELF64BE>(SymbolTable<ELF64BE> *); diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index 30ec83f4d3b..175441f564b 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -21,7 +21,7 @@ using namespace llvm::ELF; using namespace lld; using namespace lld::elf2; -bool lld::elf2::HasGotOffRel = false; +bool elf2::HasGotOffRel = false; template <class ELFT> OutputSectionBase<ELFT>::OutputSectionBase(StringRef Name, uint32_t sh_type, @@ -786,7 +786,7 @@ void OutputSection<ELFT>::addSection(InputSectionBase<ELFT> *C) { } template <class ELFT> -typename ELFFile<ELFT>::uintX_t lld::elf2::getSymVA(const SymbolBody &S) { +typename ELFFile<ELFT>::uintX_t elf2::getSymVA(const SymbolBody &S) { switch (S.kind()) { case SymbolBody::DefinedSyntheticKind: { auto &D = cast<DefinedSynthetic<ELFT>>(S); @@ -824,9 +824,9 @@ typename ELFFile<ELFT>::uintX_t lld::elf2::getSymVA(const SymbolBody &S) { // For non-local symbols, use getSymVA instead. template <class ELFT, bool IsRela> typename ELFFile<ELFT>::uintX_t -lld::elf2::getLocalRelTarget(const ObjectFile<ELFT> &File, - const Elf_Rel_Impl<ELFT, IsRela> &RI, - typename ELFFile<ELFT>::uintX_t Addend) { +elf2::getLocalRelTarget(const ObjectFile<ELFT> &File, + const Elf_Rel_Impl<ELFT, IsRela> &RI, + typename ELFFile<ELFT>::uintX_t Addend) { typedef typename ELFFile<ELFT>::Elf_Sym Elf_Sym; typedef typename ELFFile<ELFT>::uintX_t uintX_t; @@ -868,7 +868,7 @@ lld::elf2::getLocalRelTarget(const ObjectFile<ELFT> &File, // Returns true if a symbol can be replaced at load-time by a symbol // with the same name defined in other ELF executable or DSO. -bool lld::elf2::canBePreempted(const SymbolBody *Body, bool NeedsGot) { +bool elf2::canBePreempted(const SymbolBody *Body, bool NeedsGot) { if (!Body) return false; // Body is a local symbol. if (Body->isShared()) @@ -1177,9 +1177,8 @@ template <class ELFT> void StringTableSection<ELFT>::writeTo(uint8_t *Buf) { } template <class ELFT> -bool lld::elf2::shouldKeepInSymtab(const ObjectFile<ELFT> &File, - StringRef SymName, - const typename ELFFile<ELFT>::Elf_Sym &Sym) { +bool elf2::shouldKeepInSymtab(const ObjectFile<ELFT> &File, StringRef SymName, + const typename ELFFile<ELFT>::Elf_Sym &Sym) { if (Sym.getType() == STT_SECTION) return false; diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp index 4af1b88e79a..ba6317a4c06 100644 --- a/lld/ELF/Symbols.cpp +++ b/lld/ELF/Symbols.cpp @@ -124,7 +124,7 @@ template <class ELFT> static void doInitSymbols() { ElfSym<ELFT>::IgnoreUndef.setVisibility(STV_HIDDEN); } -void lld::elf2::initSymbols() { +void elf2::initSymbols() { doInitSymbols<ELF32LE>(); doInitSymbols<ELF32BE>(); doInitSymbols<ELF64LE>(); @@ -136,12 +136,12 @@ template int SymbolBody::compare<ELF32BE>(SymbolBody *Other); template int SymbolBody::compare<ELF64LE>(SymbolBody *Other); template int SymbolBody::compare<ELF64BE>(SymbolBody *Other); -template class lld::elf2::UndefinedElf<ELF32LE>; -template class lld::elf2::UndefinedElf<ELF32BE>; -template class lld::elf2::UndefinedElf<ELF64LE>; -template class lld::elf2::UndefinedElf<ELF64BE>; +template class elf2::UndefinedElf<ELF32LE>; +template class elf2::UndefinedElf<ELF32BE>; +template class elf2::UndefinedElf<ELF64LE>; +template class elf2::UndefinedElf<ELF64BE>; -template class lld::elf2::DefinedSynthetic<ELF32LE>; -template class lld::elf2::DefinedSynthetic<ELF32BE>; -template class lld::elf2::DefinedSynthetic<ELF64LE>; -template class lld::elf2::DefinedSynthetic<ELF64BE>; +template class elf2::DefinedSynthetic<ELF32LE>; +template class elf2::DefinedSynthetic<ELF32BE>; +template class elf2::DefinedSynthetic<ELF64LE>; +template class elf2::DefinedSynthetic<ELF64BE>; diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 2437a435657..0e141723bc6 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -103,7 +103,7 @@ template <class ELFT> static bool shouldUseRela() { return K == ELF64LEKind || K == ELF64BEKind; } -template <class ELFT> void lld::elf2::writeResult(SymbolTable<ELFT> *Symtab) { +template <class ELFT> void elf2::writeResult(SymbolTable<ELFT> *Symtab) { // Initialize output sections that are handled by Writer specially. // Don't reorder because the order of initialization matters. InterpSection<ELFT> Interp; @@ -1275,7 +1275,7 @@ template <class ELFT> void Writer<ELFT>::buildSectionMap() { InputToOutputSection[Name] = OutSec.first; } -template void lld::elf2::writeResult<ELF32LE>(SymbolTable<ELF32LE> *Symtab); -template void lld::elf2::writeResult<ELF32BE>(SymbolTable<ELF32BE> *Symtab); -template void lld::elf2::writeResult<ELF64LE>(SymbolTable<ELF64LE> *Symtab); -template void lld::elf2::writeResult<ELF64BE>(SymbolTable<ELF64BE> *Symtab); +template void elf2::writeResult<ELF32LE>(SymbolTable<ELF32LE> *Symtab); +template void elf2::writeResult<ELF32BE>(SymbolTable<ELF32BE> *Symtab); +template void elf2::writeResult<ELF64LE>(SymbolTable<ELF64LE> *Symtab); +template void elf2::writeResult<ELF64BE>(SymbolTable<ELF64BE> *Symtab); |