This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Do not error out if "entry symbol not found" warning and --fatal-warnings are used together.
AbandonedPublic

Authored by grimar on Sep 26 2016, 4:16 AM.

Details

Reviewers
ruiu
rafael
Summary

We produce warning "entry symbol not found". If it is used together with --fatal-warnings,
lld errors out. That is different from whar ld do, ld ignores that flag with this warning.
btw gold disagree with ld here, but I assume we want to be compatible with ld, so
I introduced new method info() that solves that problem.

Initially I fixed it as PR30521, but as Ed noticed, PR30521 links shared which does not have entry,
so this fix is not about that case, but still about difference of ld/gold.
Do we want it ?

Diff Detail

Event Timeline

grimar updated this revision to Diff 72458.Sep 26 2016, 4:16 AM
grimar retitled this revision from to [ELF] - Do not error out if "entry symbol not found" warking + --fatal-warnings are used together..
grimar updated this object.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar, evgeny777, emaste.
grimar retitled this revision from [ELF] - Do not error out if "entry symbol not found" warking + --fatal-warnings are used together. to [ELF] - Do not error out if "entry symbol not found" warning and --fatal-warnings are used together..Sep 26 2016, 4:20 AM

The case that prompted PR30521 was a shared library. Lack of an entry symbol there should not be a warning I think - I'm not sure we ought to mention it at all.

The case that prompted PR30521 was a shared library. Lack of an entry symbol there should not be a warning I think - I'm not sure we ought to mention it at all.

Right, shared case also requires patch, I`ll do it.
What do you think of this one then ?

grimar updated this object.Sep 26 2016, 6:11 AM
ruiu edited edge metadata.Sep 26 2016, 10:34 AM

I wonder if this is the right thing to do. That message is a warning message, so it seems to me that it naturally should turn into an error when --fatal-warning is given, even if that's different from what GNU ld does.

We need to emit no warning when the output is a shared library, and then I think --fatal-warnings should indeed make the warning (in an exe) an error.

grimar abandoned this revision.Sep 26 2016, 12:14 PM

This was ineffectual one.