summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/OutputSections.cpp10
-rw-r--r--lld/ELF/OutputSections.h3
-rw-r--r--lld/ELF/Writer.cpp9
3 files changed, 10 insertions, 12 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index 14bc19dc171..96a1efb455e 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -1172,16 +1172,6 @@ template <class ELFT> void StringTableSection<ELFT>::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 <class ELFT>
bool lld::elf2::shouldKeepInSymtab(const ObjectFile<ELFT> &File,
StringRef SymName,
diff --git a/lld/ELF/OutputSections.h b/lld/ELF/OutputSections.h
index 4b2d819c656..6e3c12adabd 100644
--- a/lld/ELF/OutputSections.h
+++ b/lld/ELF/OutputSections.h
@@ -60,9 +60,8 @@ typename llvm::object::ELFFile<ELFT>::uintX_t
getLocalRelTarget(const ObjectFile<ELFT> &File,
const llvm::object::Elf_Rel_Impl<ELFT, IsRela> &Rel,
typename llvm::object::ELFFile<ELFT>::uintX_t Addend);
-bool canBePreempted(const SymbolBody *Body, bool NeedsGot);
-bool includeInDynamicSymtab(const SymbolBody &B);
+bool canBePreempted(const SymbolBody *Body, bool NeedsGot);
template <class ELFT>
bool shouldKeepInSymtab(
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 6bc6e6f1a6e..91ce5831600 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -604,6 +604,15 @@ template <class ELFT> 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 <class ELFT> void Writer<ELFT>::createSections() {
// .interp needs to be on the first page in the output file.
OpenPOWER on IntegriCloud