-
-
Notifications
You must be signed in to change notification settings - Fork 470
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
Version-script difference between mold and ld #287
Comments
This is a difficult case. As you can imagine, mold applies version script rules from top to bottom, so all symbols that match GNU ld might be resolving this ambiguity by not overwriting a symbol version once a symbol name matches some pattern. But if that's the case, all symbols would be exported because they match Version script's grammar is actually odd compared to its purpose. In addition to that, use of a version script usually slows down a linker a lot, as a linker has to do lots of glob pattern matching. Let me take a look in more closely. I have an idea to rewrite version script application code, and that might be able to solve the issue and the performance issue as well. |
Like I said, I'm not knowledgeable enough to pick a team here on who is wrong or right, it was a difference nonetheless I thought was worth pointing out. It's currently not causing any issues for us, if you want to close this as won't-fix that be perfectly acceptable to me. |
As I said in the last comment, I'll try to rewrite mold's version script processing code to see if it can resolve this compatibility issue, so I'll keep this bug open. I'll update this bug when I make progress. |
I think I fixed the issue in the above commit. Please verify when you have time. Thanks! |
Seems to have done the trick! we're down to a single symbol difference between ld and mold, I'll have to find some time to extract a repro case for you next week. |
Found while validating the fix for #277 and comparing the symbols of blender linked with both ld and mold, I'll be honest, I don't know the specs well enough to being able to tell who is "wrong" or "right" here however....
a symbol that matches both global and local in a version script, ld keeps a symbol mold excludes.
given the following version script
and the following 2 symbols
GlowSequence_boost_factor_get
,_ZN5boost11this_thread18interruption_pointEv
ld will export
GlowSequence_boost_factor_get
while mold hides both symbols.repro case attached below
version_test_global_local.tar.gz
output
The text was updated successfully, but these errors were encountered: