go icon indicating copy to clipboard operation
go copied to clipboard

cmd/link: executables built with go1.26 lack DIE for runtime.firstmoduledata

Open aarzilli opened this issue 1 month ago • 5 comments

$ go version
go version go1.26-devel_0d0d5c9a82 Fri Dec 5 17:31:30 2025 -0800 linux/amd64

All operating systems and architectures affected, but mostly this is about Windows in particular.

Commit 9f5cd43fe612834e78b838c1e704bf7a98011749, reviewed on https://go.dev/cl/720660 moved the module data to its own sections, as a side effect the DIE for runtime.firstmoduledata disappeared. This DIE is used by Delve (and also, I think, by viewcore) to resolve the type of interface variables.

Using the .go.module section is, of course, fine (even preferrable). However PE executables do not seem to have this section.

Should we fake the runtime.firstmoduledata DIE? Should we add the '.go.module' section to PE executables? Should Delve (and viewcore) use the symboltable on windows specifically?

aarzilli avatar Dec 06 '25 14:12 aarzilli

cc @ianlancetaylor

aarzilli avatar Dec 06 '25 14:12 aarzilli

Related Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

gabyhelp avatar Dec 06 '25 14:12 gabyhelp

The DWARF DIE for runtime.firstmoduledata should still be present. I don't know why it disappeared. I am looking into it.

ianlancetaylor avatar Dec 06 '25 22:12 ianlancetaylor

Found the problem, will send CL. Thanks for reporting it.

ianlancetaylor avatar Dec 06 '25 22:12 ianlancetaylor

Change https://go.dev/cl/727760 mentions this issue: cmd/link: generate DWARF for moduledata

gopherbot avatar Dec 06 '25 23:12 gopherbot