Skip to content

cmd/link: DWARF5 implementation breaks debugedit #76630

@alexsaezm

Description

@alexsaezm

Go's DWARF5 line tables use DW_FORM_string for directory and file paths, which causes debugedit and other tools to fail.

It can be easily reproduced using debugedit, for example, in Delve:

$ gotip build -o dlv-upstream cmd/dlv/main.go
$ debugedit -b $(pwd) -d /usr/src/debug -i ./dlv-upstream 
[...]
debugedit: ./dlv-upstream: Unsupported .debug_line directory 0 path DW_FORM_0x8
debugedit: ./dlv-upstream: Unsupported .debug_line directory 0 path DW_FORM_0x8
debugedit: ./dlv-upstream: Unsupported .debug_line directory 0 path DW_FORM_0x8
debugedit: ./dlv-upstream: Unsupported .debug_line directory 0 path DW_FORM_0x8
debugedit: ./dlv-upstream: Unsupported .debug_line directory 0 path DW_FORM_0x8
debugedit: ./dlv-upstream: Unsupported .debug_line directory 0 path DW_FORM_0x8
debugedit: ./dlv-upstream: Unsupported .debug_line directory 0 path DW_FORM_0x8
5e781272b49e753bcddccf567b746e1edd677f9a

This behavior was detected during the previous Fedora mass rebuild when Go 1.25 made DWARF5 the default implementation. We currently have DWARF5 disabled in Fedora, CentOS Stream, and RHEL. Other distributions that use debugedit in their build pipelines might also be affected.

There is a tracking issue since the mass rebuild on the sourceware side:
https://sourceware.org/bugzilla/show_bug.cgi?id=33204

These tools expect the .debug_line_str section instead.

I created a PR, but it's worth noting that this is not a bug per se, more like a misalignment of what is expected from each other's projects. My suggested change might not be useful if it is fixed in the tooling.

https://go-review.googlesource.com/c/go/+/725160

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions