[ELF] Remove config->relocatable condition from Symbol::computeBinding

This commit is contained in:
Fangrui Song 2022-01-15 23:49:47 -08:00
parent b3cc47006b
commit c0fc09ab91
2 changed files with 2 additions and 3 deletions

View File

@ -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;

View File

@ -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);