summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/OutputSections.cpp19
-rw-r--r--lld/ELF/OutputSections.h1
2 files changed, 9 insertions, 11 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index a2a6f3ee3e3..64949f2e23e 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -1372,6 +1372,15 @@ static bool sortMipsSymbols(const std::pair<SymbolBody *, unsigned> &L,
return L.first->GotIndex < R.first->GotIndex;
}
+static uint8_t getSymbolBinding(SymbolBody *Body) {
+ uint8_t Visibility = Body->getVisibility();
+ if (Visibility != STV_DEFAULT && Visibility != STV_PROTECTED)
+ return STB_LOCAL;
+ if (Config->NoGnuUnique && Body->Binding == STB_GNU_UNIQUE)
+ return STB_GLOBAL;
+ return Body->Binding;
+}
+
template <class ELFT> void SymbolTableSection<ELFT>::finalize() {
if (this->Header.sh_size)
return; // Already finalized.
@@ -1513,16 +1522,6 @@ SymbolTableSection<ELFT>::getOutputSection(SymbolBody *Sym) {
}
template <class ELFT>
-uint8_t SymbolTableSection<ELFT>::getSymbolBinding(SymbolBody *Body) {
- uint8_t Visibility = Body->getVisibility();
- if (Visibility != STV_DEFAULT && Visibility != STV_PROTECTED)
- return STB_LOCAL;
- if (Config->NoGnuUnique && Body->Binding == STB_GNU_UNIQUE)
- return STB_GLOBAL;
- return Body->Binding;
-}
-
-template <class ELFT>
BuildIdSection<ELFT>::BuildIdSection(size_t HashSize)
: OutputSectionBase<ELFT>(".note.gnu.build-id", SHT_NOTE, SHF_ALLOC),
HashSize(HashSize) {
diff --git a/lld/ELF/OutputSections.h b/lld/ELF/OutputSections.h
index 432a44176f1..a0d4df035d8 100644
--- a/lld/ELF/OutputSections.h
+++ b/lld/ELF/OutputSections.h
@@ -217,7 +217,6 @@ private:
void writeGlobalSymbols(uint8_t *Buf);
const OutputSectionBase<ELFT> *getOutputSection(SymbolBody *Sym);
- static uint8_t getSymbolBinding(SymbolBody *Body);
SymbolTable<ELFT> &Table;
OpenPOWER on IntegriCloud