Skip to content

Commit c0fc09a

Browse files
committed
[ELF] Remove config->relocatable condition from Symbol::computeBinding
1 parent b3cc470 commit c0fc09a

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lld/ELF/Symbols.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,6 @@ MemoryBufferRef LazyArchive::getMemberBuffer() {
268268
}
269269

270270
uint8_t Symbol::computeBinding() const {
271-
if (config->relocatable)
272-
return binding;
273271
if ((visibility != STV_DEFAULT && visibility != STV_PROTECTED) ||
274272
(versionId == VER_NDX_LOCAL && !isLazy()))
275273
return STB_LOCAL;

lld/ELF/Writer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1972,7 +1972,8 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() {
19721972
for (Symbol *sym : symtab->symbols()) {
19731973
if (!sym->isUsedInRegularObj || !includeInSymtab(*sym))
19741974
continue;
1975-
sym->binding = sym->computeBinding();
1975+
if (!config->relocatable)
1976+
sym->binding = sym->computeBinding();
19761977
if (in.symTab)
19771978
in.symTab->addSymbol(sym);
19781979

0 commit comments

Comments
 (0)