-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
.debug_gdb_scripts is being loaded into memory #81028
Comments
This is basically a regression of issue #41626 |
somewhat relevant is #77961 I wouldn't be surprised if somebody went ahead and marked it as allocatable so that the linker preserves it in the final binary at all... |
A symbol in this section is directly referenced in the main shim using rust/compiler/rustc_codegen_ssa/src/base.rs Line 408 in f1ca558
rust/compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs Lines 14 to 28 in 673d0db
|
OK, so it is supposed to be alloc then. |
That looks like an ancient way to emulate the |
#[used]
#[link_section = ".abc"]
#[no_mangle]
pub static FOO: u8 = 0;
fn main() {} Does not result in an executable with an
From the linked rfc:
|
If I build:
with
rustc -g --crate-type bin --emit obj -o t.o t.rs
, and look at the output ofreadelf -St t.o
I see:According to #41627, this is not supposed to be an alloc section (ie, loaded into memory), but only present in the object file.
Having this section loaded isn't a huge problem in itself, but when combined with
--link-arg -Wl,--strip-all
(or--strip-debug
) it triggers a crash in lld: https://bugs.llvm.org//show_bug.cgi?id=44878There are lld fixes pending (https://reviews.llvm.org/D74510, https://reviews.llvm.org/D91291)(lld is already fixed), but it still seems like making .debug_gdb_scripts alloc is unintended.Meta
rustc --version --verbose
:cc @eddyb @ayermolo
The text was updated successfully, but these errors were encountered: