If I build:
with rustc -g --crate-type bin --emit obj -o t.o t.rs, and look at the output of readelf -St t.o I see:
[27] .debug_gdb_scripts
PROGBITS PROGBITS 0000000000000000 0000000000000270 0
0000000000000022 0000000000000001 0 1
[0000000000000032]: ALLOC, MERGE, STRINGS
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=44878
There 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:
rustc 1.49.0 (e1884a8e3 2020-12-29)
binary: rustc
commit-hash: e1884a8e3c3e813aada8254edfa120e85bf5ffca
commit-date: 2020-12-29
host: x86_64-unknown-linux-gnu
release: 1.49.0
cc @eddyb @ayermolo
If I build:
with
rustc -g --crate-type bin --emit obj -o t.o t.rs, and look at the output ofreadelf -St t.oI 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