This is an archive of the discontinued LLVM Phabricator instance.

ELF: Compute used bit for --as-needed during symbol resolution.
ClosedPublic

Authored by pcc on Jun 8 2016, 11:16 PM.
Tokens
"Like" token, awarded by waxmiguel.

Details

Summary

We can now use this to decide whether to emit a verneed during the final
pass over the symbols. We were previously wrongly creating a verneed entry
in the case where all references to a DSO's symbols were weak.

In a future change we may also want to use the used bit to control whether
shared symbols are preemptible and appear in the dynsym. This seems a little
tricky to do at the moment because isNeeded() is templated.

The only other functional change here is that we emit a DT_NEEDED for DSOs
whose symbols are all preempted by objects that appear later in the link. But
that doesn't seem too important to me.

Diff Detail

Repository
rL LLVM

Event Timeline

pcc updated this revision to Diff 60139.Jun 8 2016, 11:16 PM
pcc retitled this revision from to ELF: Compute used bit for --as-needed during symbol resolution..
pcc updated this object.
pcc added reviewers: rafael, ruiu.
pcc added a subscriber: llvm-commits.
rafael accepted this revision.Jun 9 2016, 4:26 AM
rafael edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jun 9 2016, 4:26 AM
ruiu accepted this revision.Jun 9 2016, 10:18 AM
ruiu edited edge metadata.

LGTM

This revision was automatically updated to reflect the committed changes.