Skip to content

external and compressed debug info #2300

@daurnimator

Description

@daurnimator

There are a couple of object sections I'd like to be able to use when creating applications/libraries in zig.

.gnu_debuglink

From https://sourceware.org/binutils/docs/binutils/objcopy.html:

Part of the process of adding the .gnu_debuglink section involves embedding a checksum of the contents of the debug info file into the section.

From https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html#Separate-Debug-Files

A debug link is a special section of the executable file named .gnu_debuglink. The section must contain:

  • A filename, with any leading directory components removed, followed by a zero byte,
  • zero to three bytes of padding, as needed to reach the next four-byte boundary within the section, and
  • a four-byte CRC checksum, stored in the same endianness used for the executable file itself. The checksum is computed on the debugging information file’s full contents by the function given below, passing zero as the crc argument.

Any executable file format can carry a debug link, as long as it can contain a section named .gnu_debuglink with the contents described above.

.gnu_debugdata

From https://sourceware.org/gdb/onlinedocs/gdb/MiniDebugInfo.html:

.gnu_debugdata section. This feature is called MiniDebugInfo. This section holds an LZMA-compressed object and is used to supply extra symbols for backtraces.

Related to #2851

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions