Skip to content

rust_eh_personality exported by cdylibs #92102

Closed
@bjorn3

Description

@bjorn3

I tried this:

$ echo | rustc - --crate-type cdylib
$ bingrep librust_out.so
[...]
Dyn Syms(13):
               Addr   Bind       Type        Symbol                            Size     Section     Other
[...]
              1300    GLOBAL     FUNC        rust_eh_personality               0x2e5    .text(11)   0x0
[...]

I expected to see this happen: No symbols are exported as there are no #[no_mangle] symbols in the crate source.

Instead, this happened: rust_eh_personality is exported. This means that different rustc versions could potentially interfere with unwinding of code compiled by the other rustc version by overriding this symbol.

Meta

rustc --version --verbose:

rustc 1.59.0-nightly (91a0600a5 2021-12-18)
binary: rustc
commit-hash: 91a0600a5c22b9d159e3c57526af83e71d1120f8
commit-date: 2021-12-18
host: x86_64-unknown-linux-gnu
release: 1.59.0-nightly
LLVM version: 13.0.0

and

rustc 1.56.0 (09c42c458 2021-10-18)
binary: rustc
commit-hash: 09c42c45858d5f3aedfa670698275303a3d19afa
commit-date: 2021-10-18
host: x86_64-unknown-linux-gnu
release: 1.56.0
LLVM version: 13.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions