This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Don't warn about missing start symbol in relocatable and shared files
AbandonedPublic

Authored by phosek on Sep 24 2016, 7:34 PM.

Details

Reviewers
ruiu
rafael
Summary

Previously LLD would print a warning for missing entry symbol in relocatable and shared output files, which is incorrect as these normally don't have an entry symbol.

Diff Detail

Event Timeline

phosek updated this revision to Diff 72408.Sep 24 2016, 7:34 PM
phosek retitled this revision from to [ELF] Don't warn about missing start symbol in relocatable and shared files.
phosek updated this object.
phosek added a reviewer: ruiu.
phosek added a project: lld.
phosek added subscribers: llvm-commits, phosek.
davide added a subscriber: davide.Sep 24 2016, 7:39 PM

Did you try gold/bfd and see how they behave?

This comment was removed by phosek.

Yes, neither of them emits the warning. This was actually discovered while linking an existing code which relies heavily on relocatable objects where BFD ld and gold are both silent but LLD would emit a lot of warnings.

I think this one is OK. Please wait for Rafael sign-off as he introduced the feature (and the warning)

ruiu added inline comments.Sep 26 2016, 9:52 AM
ELF/Driver.cpp
679

HasEntry and HasEntryAddr seem a bit confusing here. I think you only had to change this line to

if (!HasEntryAddr && !Config->Entry.empty()) {

no?

I'm happy to to let George land his change https://reviews.llvm.org/D24913 and abandon this one if you prefer his solution.

ruiu edited edge metadata.Sep 26 2016, 11:07 AM

Yeah, I didn't notice until now that his change is exactly what I suggested. I'll LGTM his change.

grimar added a subscriber: grimar.Sep 26 2016, 12:11 PM

Thanks, Petr and sorry I really did not notice you're already working on this, just was trying to fix unassigned PR30521 :]

rafael edited edge metadata.Sep 26 2016, 12:12 PM

This LGTM with "HasEntry" rename something like "EntrySymbolExpected"