This is an archive of the discontinued LLVM Phabricator instance.

ELF: Undefine all symbols, not just those that we expect to be defined.
ClosedPublic

Authored by pcc on May 4 2016, 8:13 PM.

Details

Summary

This allows the combined LTO object to provide a definition with the same
name as a symbol that was internalized without causing a duplicate symbol
error. This normally happens during parallel codegen which externalizes
originally-internal symbols, for example.

In order to make this work, I needed to relax the undefined symbol error to
only report an error for symbols that are used in regular objects.

Diff Detail

Repository
rL LLVM

Event Timeline

pcc updated this revision to Diff 56234.May 4 2016, 8:13 PM
pcc retitled this revision from to ELF: Undefine all symbols, not just those that we expect to be defined..
pcc updated this object.
pcc added reviewers: rafael, ruiu.
pcc added a subscriber: llvm-commits.
rafael accepted this revision.May 5 2016, 7:43 AM
rafael edited edge metadata.

This will allow an undefined in a .bc file as long as lto optimizes it out, no?
I guess that is OK, but would be nice to add a comment about it.

test/ELF/lto/parallel-internalize.ll
4 ↗(On Diff #56234)

Please also check the symbols in the final binary.

We should have only foo, right? Bar should still be internalized and when splitting it will be marked hidden.

This revision is now accepted and ready to land.May 5 2016, 7:43 AM
This revision was automatically updated to reflect the committed changes.