From 89f4ec74c18586b3596b37672fec58afd5cea2c8 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Fri, 25 Dec 2015 07:01:09 +0000 Subject: [PATCH] Move a function to a file where it is used. llvm-svn: 256410 --- lld/ELF/OutputSections.cpp | 10 ---------- lld/ELF/OutputSections.h | 3 +-- lld/ELF/Writer.cpp | 9 +++++++++ 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index 14bc19dc171b..96a1efb455e1 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -1172,16 +1172,6 @@ template void StringTableSection::writeTo(uint8_t *Buf) { memcpy(Buf, Data.data(), Data.size()); } -bool lld::elf2::includeInDynamicSymtab(const SymbolBody &B) { - uint8_t V = B.getVisibility(); - if (V != STV_DEFAULT && V != STV_PROTECTED) - return false; - - if (Config->ExportDynamic || Config->Shared) - return true; - return B.isUsedInDynamicReloc(); -} - template bool lld::elf2::shouldKeepInSymtab(const ObjectFile &File, StringRef SymName, diff --git a/lld/ELF/OutputSections.h b/lld/ELF/OutputSections.h index 4b2d819c6565..6e3c12adabd6 100644 --- a/lld/ELF/OutputSections.h +++ b/lld/ELF/OutputSections.h @@ -60,9 +60,8 @@ typename llvm::object::ELFFile::uintX_t getLocalRelTarget(const ObjectFile &File, const llvm::object::Elf_Rel_Impl &Rel, typename llvm::object::ELFFile::uintX_t Addend); -bool canBePreempted(const SymbolBody *Body, bool NeedsGot); -bool includeInDynamicSymtab(const SymbolBody &B); +bool canBePreempted(const SymbolBody *Body, bool NeedsGot); template bool shouldKeepInSymtab( diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 6bc6e6f1a6e6..91ce5831600d 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -604,6 +604,15 @@ template static bool includeInSymtab(const SymbolBody &B) { return true; } +static bool includeInDynamicSymtab(const SymbolBody &B) { + uint8_t V = B.getVisibility(); + if (V != STV_DEFAULT && V != STV_PROTECTED) + return false; + if (Config->ExportDynamic || Config->Shared) + return true; + return B.isUsedInDynamicReloc(); +} + // Create output section objects and add them to OutputSections. template void Writer::createSections() { // .interp needs to be on the first page in the output file.