This is an archive of the discontinued LLVM Phabricator instance.

[LTO] Create Undefined Bitcode symbol when we drop a comdat member
ClosedPublic

Authored by davide on Apr 21 2016, 2:10 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

davide updated this revision to Diff 54574.Apr 21 2016, 2:10 PM
davide retitled this revision from to [LTO] Create Undefined Bitcode symbol when we drop a comdat member.
davide updated this object.
davide added a reviewer: rafael.
davide added a subscriber: llvm-commits.
rafael added inline comments.Apr 22 2016, 10:11 AM
ELF/InputFiles.cpp
486 ↗(On Diff #54574)

With this Body never gets to

if (GV && GV->isThreadLocal())
  Body->Type = STT_TLS;

so STT_TLS (and on trunk CanOmitFromDynSym) is never set.

Maybe we could split this function in two? One uses early returns to just construct the Body and the second one sets STT_TLS and CanOmitFromDynSym.

test/ELF/lto/comdat2.ll
3 ↗(On Diff #54574)

I think this test already passes when linking in this order, no?

I think it is "%t2.o %t.o" that is currently broken. How about just testing both orders?

davide updated this revision to Diff 54683.Apr 22 2016, 11:23 AM

Addressed comments. If you don't like the helper names, feel free to suggest better ones.

rafael accepted this revision.Apr 22 2016, 11:27 AM
rafael edited edge metadata.

LGTM with a nit.

ELF/InputFiles.cpp
522 ↗(On Diff #54683)

This helper doesn't help much. Please inline it.

This revision is now accepted and ready to land.Apr 22 2016, 11:27 AM
This revision was automatically updated to reflect the committed changes.