Skip to content

Avoid volatile loads to preserve the gdb pretty printer section #44993

Open
@alexcrichton

Description

@alexcrichton

Right now when you compile a program with debuginfo on Linux we'll emit a volatile load of a gdb pretty printer section which is intended on ensuring that the linker forces a section in the executable.

Apparently, though, this has caused some problems for embedded work (cc @japaric) where the section doesn't always make it to the final image that's flashed to devices, meaning that this stray load near the beginning of the program can sometimes cause problems.

We should look into other solutions to force the linker to keep this symbol I think. Right now we're passing a version script on Linux to preserve symbols in cdylibs and I think the same would work for this? Worth trying out!

cc @michaelwoerister

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)A-linkageArea: linking into static, shared libraries and binariesC-enhancementCategory: An issue proposing an enhancement or a PR with one.P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.WG-embeddedWorking group: Embedded systems

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions