This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Keep symbols specified by '-u' over LTO.
ClosedPublic

Authored by ikudrin on Sep 28 2017, 2:42 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

ikudrin created this revision.Sep 28 2017, 2:42 AM
ruiu edited edge metadata.Oct 1 2017, 7:28 PM

I'm not sure if this is the right thing to do. It feels like I could argue either this is correct or this is incorrect.

I'd think this is probably okay, but please do not copy-n-paste the same comment.

In D38348#885488, @ruiu wrote:

I'm not sure if this is the right thing to do. It feels like I could argue either this is correct or this is incorrect.

Honestly, I feel the same. I can see the following pros and cons:

Pros:

  • It fits POLA better because keeping symbols you explicitly asked for is just natural. I can remember that I was a bit puzzled once in the similar situation.
  • It makes handling "-e" and "-u" symbols the same, see D37332#861693.
  • It doesn't harm anything because without LTO those symbols would be preserved anyway.

Cons:

  • As far as I know, nobody asked for it so far.
  • "-u" is intended to only fetch asked symbols from archives. It says nothing about keeping symbols themselves.

Consequently, it's probably safe and makes things a bit better.

ruiu accepted this revision.Oct 2 2017, 2:58 PM

LGTM. Please go ahead.

This revision is now accepted and ready to land.Oct 2 2017, 2:58 PM
This revision was automatically updated to reflect the committed changes.