[PATCH] D38348: [ELF] Keep symbols specified by '-u' over LTO.

Igor Kudrin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 1 21:22:06 PDT 2017


ikudrin added a comment.

In https://reviews.llvm.org/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 <https://en.wikipedia.org/wiki/Principle_of_least_astonishment> 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 https://reviews.llvm.org/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.


Repository:
  rL LLVM

https://reviews.llvm.org/D38348





More information about the llvm-commits mailing list