-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ThinLTO exposes too many symbols #46374
Comments
I've been trying to figure out what's going on here but I'm sort of quickly coming to the end of my rope. A few points of note though... Right now ThinLTO works by needing complete and total knowledge (AFAIK) of exported and internal symbols. Thankfully we as the compiler actually have this information so we're just handing it down to ThinLTO. Notably, we're creating our ThinLTO data with a list of symbols to preserve. Currently, however, we're recursively walking all symbols and creating a very large The The next use of So it turns out that one clause of this So alright this I'm going to try to work with @dcci to see if he can help me drill into this. |
For example given this code:
Let's compile without ThinLTO and take a look at the symbols:
Here we're particularly interested in
ZN3foo1a1A17h6d4d0e10f3b
, thea::A
constant from above. As expected this isLOCAL
andDEFAULT
, notably not exported from the object file as it's still internalized.Let's instead compile with ThinLTO:
Oh dear! Our
_ZN3foo1a1A17h6d4d0e10f3b
symbol has been promoted toGLOBAL
andHIDDEN
. That's not good! This symbol,a::A
, should stay internalized even when compiling with ThinLTOThe text was updated successfully, but these errors were encountered: