Skip to content

rustc marks .debug_gdb_scripts as ALLOC, LOAD #41626

Closed
@whitequark

Description

@whitequark

To reproduce:

echo "fn main(){}" >t.rs
rustc -g t.rs
objdump -h t|grep -A1 debug_gdb_scripts
 16 .debug_gdb_scripts 00000022  000000000003ddc1  000000000003ddc1  0003ddc1  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA

This is not a big deal on PCs, but somewhat more important on a microcontroller. On top of that, it produces extremely surprising messages when flashing the firmware via gdb (which is how I discovered it):

Loading section .text, size 0x1ae lma 0x0
Loading section .debug_gdb_scripts, size 0x22 lma 0x1ae

... and the debug script path potentially ends in the non-volatile storage, unnecessarily exposing information about the build environment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions