Skip to content
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

Allow --version-script for executables with dynsym #19871

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MasterAwesome
Copy link

@MasterAwesome MasterAwesome commented May 6, 2024

When executable has -rdynamic this adds --export-dynamic to linker argument with no way to control the exported dynamic symbols. Version script can be used here to control symbols.

Tests:

  • Linker appends -version-script for binaries when -rdynamic is present.
  • Linker doesn't append -version-script for binaries when -rdynamic isn't present.
  • $ stage4/bin/zig build test -Denable-llvm -Dskip-release -Dskip-non-native
$ nm -D ./main # See linked issue for code
0000000001000a18 R FOO

$ llvm-readelf -Ss ./main
<snipped>
  [ 6] .custom           PROGBITS        0000000001000a18 000a18 000004 00   A  0   0  1
<snipped>

Closes: #19870

When executable has `-rdynamic` this adds `--export-dynamic` to linker
argument with no way to control the exported dynamic symbols. Version
script can be used here to control the output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--version-script should be applicable for --export-dynamic binaries
1 participant