[go] cmd/internal/objfile: fix PE BSS symbol classification

0 views
Skip to first unread message

Quim Muntal (Gerrit)

unread,
Jun 30, 2026, 1:06:15 PM (23 hours ago) Jun 30
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Junyang Shao, Dmitri Shuralyov, Ian Lance Taylor, golang...@luci-project-accounts.iam.gserviceaccount.com, David Chase, Dmitri Shuralyov, golang-co...@googlegroups.com

Quim Muntal submitted the change

Change information

Commit message:
cmd/internal/objfile: fix PE BSS symbol classification

The PE symbol reader uses runtime.bss to distinguish initialized data
from BSS when Windows internal linking places BSS at the end of a
writable data section.

For externally linked PE files, symbol values are section-relative, so
comparing a symbol in one section against runtime.bss from another
section can misclassify initialized data such as runtime.noptrdata as
BSS.

Remember the section containing runtime.bss and only apply the
BSS-boundary heuristic to symbols from that same section.

cmd/nm.TestExternalLinkerCgoExec fails with some Mingw-w64 toolchains
without this fix.
Change-Id: Idd815b2c828c4105ca43989919a64134cd06d94a
Reviewed-by: Dmitri Shuralyov <dmit...@google.com>
Reviewed-by: Ian Lance Taylor <ia...@golang.org>
Auto-Submit: Quim Muntal <quimm...@gmail.com>
Reviewed-by: Junyang Shao <shaoj...@google.com>
Files:
  • M src/cmd/internal/objfile/pe.go
Change size: XS
Delta: 1 file changed, 3 insertions(+), 1 deletion(-)
Branch: refs/heads/master
Submit Requirements:
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Idd815b2c828c4105ca43989919a64134cd06d94a
Gerrit-Change-Number: 795640
Gerrit-PatchSet: 2
Gerrit-Owner: Quim Muntal <quimm...@gmail.com>
Gerrit-Reviewer: David Chase <drc...@google.com>
Gerrit-Reviewer: Dmitri Shuralyov <dmit...@google.com>
Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
Gerrit-Reviewer: Quim Muntal <quimm...@gmail.com>
Gerrit-CC: Dmitri Shuralyov <dmit...@golang.org>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages