-
Notifications
You must be signed in to change notification settings - Fork 13.5k
use --dynamic-list
for exporting executable symbols
#143446
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
Conversation
Some changes occurred in compiler/rustc_codegen_ssa |
a18772a
to
63d952e
Compare
63d952e
to
abf1ccc
Compare
@bors r+ rollup |
@bors r- |
abf1ccc
to
ea6a131
Compare
@rustbot ready |
ea6a131
to
6fe2ad8
Compare
@bors r=bjorn3,oli-obk |
…r=bjorn3,oli-obk use `--dynamic-list` for exporting executable symbols closes rust-lang#101610 cc rust-lang#84161 https://sourceware.org/binutils/docs-2.39/ld/VERSION.html: > --dynamic-list=dynamic-list-file Specify the name of a dynamic list file to the linker. This is typically used when creating shared libraries to specify a list of global symbols whose references shouldn’t be bound to the definition within the shared library, or creating dynamically linked executables to specify a list of symbols which should be added to the symbol table in the executable. This option is only meaningful on ELF platforms which support shared libraries. `ld.lld --help`: > --dynamic-list=<file>: Similar to --export-dynamic-symbol-list. When creating a shared object, this additionally implies -Bsymbolic but does not set DF_SYMBOLIC > --export-dynamic-symbol-list=file: Read a list of dynamic symbol patterns. Apply --export-dynamic-symbol on each pattern > --export-dynamic-symbol=glob: (executable) Put matched symbols in the dynamic symbol table. (shared object) References to matched non-local STV_DEFAULT symbols shouldn't be bound to definitions within the shared object. Does not imply -Bsymbolic. > --export-dynamic: Put symbols in the dynamic symbol table Use `--dynamic-list` because it's older than `--export-dynamic-symbol-list` (binutils 2.35)
Rollup of 6 pull requests Successful merges: - #143398 (tidy: add support for `--extra-checks=auto:` feature) - #143446 (use `--dynamic-list` for exporting executable symbols) - #143644 (Add triagebot stdarch mention ping) - #143660 (Disable docs for `compiler-builtins` and `sysroot`) - #143666 (Re-expose nested bodies in rustc_borrowck::consumers) - #143668 (Fix VxWorks build errors) r? `@ghost` `@rustbot` modify labels: rollup
Probably failed in #143676 (comment). @bors r- |
fn main() { | ||
unsafe { | ||
let handle = libc::dlopen(std::ptr::null(), libc::RTLD_NOW); | ||
let ptr = libc::dlsym(handle, c"hack".as_ptr()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dlsym doesn't work for statically linked musl. This either needs -Ctarget-feature=-crt-static
on musl or to exclude musl entirely.
6fe2ad8
to
bf6d29d
Compare
@rustbot ready |
@bors r=bjorn3,oli-obk |
Rollup of 9 pull requests Successful merges: - #143446 (use `--dynamic-list` for exporting executable symbols) - #143590 (Fix weird rustdoc output when single and glob reexport conflict on a name) - #143599 (emit `.att_syntax` when global/naked asm use that option) - #143615 (Fix handling of no_std targets in `doc::Std` step) - #143632 (fix: correct parameter names in LLVMRustBuildMinNum and LLVMRustBuildMaxNum FFI declarations) - #143640 (Constify `Fn*` traits) - #143651 (Win: Use exceptions with empty data for SEH panic exception copies instead of a new panic) - #143660 (Disable docs for `compiler-builtins` and `sysroot`) - #143665 ([rustdoc-json] Add tests for `#[doc(hidden)]` handling of items.) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #143446 - usamoi:export-executable-symbols, r=bjorn3,oli-obk use `--dynamic-list` for exporting executable symbols closes #101610 cc #84161 https://sourceware.org/binutils/docs-2.39/ld/VERSION.html: > --dynamic-list=dynamic-list-file Specify the name of a dynamic list file to the linker. This is typically used when creating shared libraries to specify a list of global symbols whose references shouldn’t be bound to the definition within the shared library, or creating dynamically linked executables to specify a list of symbols which should be added to the symbol table in the executable. This option is only meaningful on ELF platforms which support shared libraries. `ld.lld --help`: > --dynamic-list=<file>: Similar to --export-dynamic-symbol-list. When creating a shared object, this additionally implies -Bsymbolic but does not set DF_SYMBOLIC > --export-dynamic-symbol-list=file: Read a list of dynamic symbol patterns. Apply --export-dynamic-symbol on each pattern > --export-dynamic-symbol=glob: (executable) Put matched symbols in the dynamic symbol table. (shared object) References to matched non-local STV_DEFAULT symbols shouldn't be bound to definitions within the shared object. Does not imply -Bsymbolic. > --export-dynamic: Put symbols in the dynamic symbol table Use `--dynamic-list` because it's older than `--export-dynamic-symbol-list` (binutils 2.35) try-job: dist-i586-gnu-i586-i686-musl
Rollup of 9 pull requests Successful merges: - rust-lang/rust#143446 (use `--dynamic-list` for exporting executable symbols) - rust-lang/rust#143590 (Fix weird rustdoc output when single and glob reexport conflict on a name) - rust-lang/rust#143599 (emit `.att_syntax` when global/naked asm use that option) - rust-lang/rust#143615 (Fix handling of no_std targets in `doc::Std` step) - rust-lang/rust#143632 (fix: correct parameter names in LLVMRustBuildMinNum and LLVMRustBuildMaxNum FFI declarations) - rust-lang/rust#143640 (Constify `Fn*` traits) - rust-lang/rust#143651 (Win: Use exceptions with empty data for SEH panic exception copies instead of a new panic) - rust-lang/rust#143660 (Disable docs for `compiler-builtins` and `sysroot`) - rust-lang/rust#143665 ([rustdoc-json] Add tests for `#[doc(hidden)]` handling of items.) r? `@ghost` `@rustbot` modify labels: rollup
closes #101610
cc #84161
https://sourceware.org/binutils/docs-2.39/ld/VERSION.html:
ld.lld --help
:Use
--dynamic-list
because it's older than--export-dynamic-symbol-list
(binutils 2.35)try-job: dist-i586-gnu-i586-i686-musl