Skip to content

Commit

Permalink
[ELF] Remove config->relocatable condition from Symbol::computeBinding
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskRay committed Jan 16, 2022
1 parent b3cc470 commit c0fc09a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 0 additions & 2 deletions lld/ELF/Symbols.cpp
Expand Up @@ -268,8 +268,6 @@ MemoryBufferRef LazyArchive::getMemberBuffer() {
}

uint8_t Symbol::computeBinding() const {
if (config->relocatable)
return binding;
if ((visibility != STV_DEFAULT && visibility != STV_PROTECTED) ||
(versionId == VER_NDX_LOCAL && !isLazy()))
return STB_LOCAL;
Expand Down
3 changes: 2 additions & 1 deletion lld/ELF/Writer.cpp
Expand Up @@ -1972,7 +1972,8 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() {
for (Symbol *sym : symtab->symbols()) {
if (!sym->isUsedInRegularObj || !includeInSymtab(*sym))
continue;
sym->binding = sym->computeBinding();
if (!config->relocatable)
sym->binding = sym->computeBinding();
if (in.symTab)
in.symTab->addSymbol(sym);

Expand Down

0 comments on commit c0fc09a

Please sign in to comment.