-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Find the "best" order for local symbols #36064
Comments
Do you have URL for discussion topic you mentioned? |
https://groups.google.com/forum/#!topic/generic-abi/tSU1wY1xyY8 |
The second looks nice, but LLD does not keep file symbols currently. |
The tool we have uses just .o files, so we would have to write it there. Adding file symbols to lld should be simple, no? |
Should be. That will increase the output size by some amount. |
r329787 |
mentioned in issue llvm/llvm-bugzilla-archive#48023 |
Extended Description
There is an interesting discussion at generic-abi@googlegroups.com about the order of local symbols.
The ELF spec doesn't say anything about it, so we can try to figure out what is the most convenient for linkers and consumers
Linking
local1:
.global hidden1
.hidden hidden1
hidden1:
And
local2:
.global hidden2
.hidden hidden2
hidden2:
The results are
lld: local1, local2, hidden1, hidden2
bfd: file1, corrupted file2?, hidden1, hidden2
gold: file1, local1, file2, local2, hidden1, hidden2
Gold's output has the advantage that one can map the original local symbols to a file. The exception being that the hidden symbols show up as being from file2 (one can still check the visibility to tell the difference).
Two orders that might be ever better are
The first one has the advantage of making it easy to find out the file of local symbols.
The second one has the advantage of specifying where the hidden symbols came from.
The text was updated successfully, but these errors were encountered: