diff options
Diffstat (limited to 'lld/ELF/OutputSections.cpp')
-rw-r--r-- | lld/ELF/OutputSections.cpp | 19 |
1 files changed, 9 insertions, 10 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) { |