diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2016-04-26 13:50:46 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2016-04-26 13:50:46 +0000 |
commit | 9e32e4fe860534c1002d65e913287e309582d97c (patch) | |
tree | 937a692fc75d8db5b56a6054e5c1c76f64e2ff02 /lld/ELF/OutputSections.cpp | |
parent | a24427533f16c173b2f6a4a6771b816db660c936 (diff) | |
download | bcm5719-llvm-9e32e4fe860534c1002d65e913287e309582d97c.tar.gz bcm5719-llvm-9e32e4fe860534c1002d65e913287e309582d97c.zip |
Store the binding in the Symbol.
This remove a fixme, cleans up the weak undef interaction with archives and
lets us keep weak undefs still weak if they resolve to shared.
llvm-svn: 267555
Diffstat (limited to 'lld/ELF/OutputSections.cpp')
-rw-r--r-- | lld/ELF/OutputSections.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index 6eeaa3ffc8e..146eaff0b7c 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -1363,12 +1363,13 @@ static bool sortMipsSymbols(const std::pair<SymbolBody *, unsigned> &L, } static uint8_t getSymbolBinding(SymbolBody *Body) { - uint8_t Visibility = Body->Backref->Visibility; + Symbol *S = Body->Backref; + uint8_t Visibility = S->Visibility; if (Visibility != STV_DEFAULT && Visibility != STV_PROTECTED) return STB_LOCAL; - if (Config->NoGnuUnique && Body->Binding == STB_GNU_UNIQUE) + if (Config->NoGnuUnique && S->Binding == STB_GNU_UNIQUE) return STB_GLOBAL; - return Body->Binding; + return S->Binding; } template <class ELFT> void SymbolTableSection<ELFT>::finalize() { @@ -1442,7 +1443,7 @@ void SymbolTableSection<ELFT>::writeLocalSymbols(uint8_t *&Buf) { } ESym->st_name = P.second; ESym->st_size = Body.template getSize<ELFT>(); - ESym->setBindingAndType(Body.Binding, Body.Type); + ESym->setBindingAndType(STB_LOCAL, Body.Type); Buf += sizeof(*ESym); } } |