Page MenuHomePhabricator

[ELF] Drop unnecessary VersionId setting in scanShlibUndefined

Authored by smeenai on Dec 30 2017, 12:39 AM.



LLD previously used to handle dynamic lists and version scripts in the
exact same way, even though they have very different semantics for
shared libraries and subtly different semantics for executables. r315114
untangled their semantics for executables (building on previous work to
correct their semantics for shared libraries). With that change, dynamic
lists won't set the default version to VER_NDX_LOCAL, and so resetting
the version to VER_NDX_GLOBAL in scanShlibUndefined is unnecessary.

This was causing an issue because version scripts containing local: *
work by setting the default version to VER_NDX_LOCAL, but scanShlibUndefined
would override this default, and therefore symbols which should have
been local would end up in the dynamic symbol table, which differs from
both bfd and gold's behavior. gold silently keeps the symbol hidden in
such a scenario, whereas bfd issues an error. I prefer bfd's behavior
and plan to implement that in LLD in a follow-up (and the test case
added here will be updated accordingly).

Diff Detail


Event Timeline

smeenai created this revision.Dec 30 2017, 12:39 AM
smeenai edited reviewers, added: espindola; removed: rafael.Dec 30 2017, 8:37 PM
This revision is now accepted and ready to land.Jan 7 2018, 9:53 PM
This revision was automatically updated to reflect the committed changes.