This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Make IR symbols be visible when doing relocatable link.
ClosedPublic

Authored by grimar on Aug 21 2017, 6:48 AM.

Details

Summary

This is PR33097.
Previously when doing relocatable link, all IR symbols were absent
in result object file. Patch makes external symbols to be exported.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar created this revision.Aug 21 2017, 6:48 AM
davide added a subscriber: davide.Aug 21 2017, 7:09 AM

This is fine, but maybe too conservative.
You just need to keep externals, not everything in a relocatable (unless being in a relocatable implies being external, in which case, that needs a comment :)
I proposed an alternative https://reviews.llvm.org/D36959 (feel free to take a look and review/reply)

Apologies, this should be fine.
Peter made me realize we should never see STB_LOCAL here.

davide added a reviewer: pcc.Aug 21 2017, 10:33 AM
pcc accepted this revision.Aug 21 2017, 10:40 AM

LGTM with a comment explaining why we must preserve these symbols.

This revision is now accepted and ready to land.Aug 21 2017, 10:40 AM
This revision was automatically updated to reflect the committed changes.