Diff Detail
Event Timeline
| ELF/LTO.cpp | ||
|---|---|---|
| 149 | Don't we need to allow STV_PROTECTED ? if (Config->Relocatable)
R.VisibleToRegularObj =
Sym->Binding != STB_LOCAL &&
(Sym->Visibility == STV_DEFAULT || Sym->Visibility == STV_PROTECTED);
else
R.VisibleToRegularObj = Sym->IsUsedInRegularObj ||
(R.Prevailing && Sym->includeInDynsym()) ||
UsedStartStop.count(ObjSym.getSectionName()); | |
| ELF/LTO.cpp | ||
|---|---|---|
| 149 | Yes, I'm under the impression we need to handle also PROTECTED here. Peter? | |
| ELF/LTO.cpp | ||
|---|---|---|
| 149 | I don't think we can drop any global symbols here regardless of visibility. Hidden symbols may only be dropped during a final (exec or DSO) link. | |
| ELF/LTO.cpp | ||
|---|---|---|
| 149 | I assume we can drop symbols marked with STB_LOCAL binding though? | |
| ELF/LTO.cpp | ||
|---|---|---|
| 149 | I don't think we should ever see STB_LOCAL symbols here during a relocatable link because:
| |
Oh, fair enough, my bad.
I guess George's patch should go in instead. Let me abandon this.
Don't we need to allow STV_PROTECTED ?
Also you can probably omit calling computeBinding() as it always return just Binding for relocatable output anyways.
And ExternalReloc sound similar to "External relocation", a bit confusing naming IMO. May be better to not define any variable at all, and just:
if (Config->Relocatable) R.VisibleToRegularObj = Sym->Binding != STB_LOCAL && (Sym->Visibility == STV_DEFAULT || Sym->Visibility == STV_PROTECTED); else R.VisibleToRegularObj = Sym->IsUsedInRegularObj || (R.Prevailing && Sym->includeInDynsym()) || UsedStartStop.count(ObjSym.getSectionName());