aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqmuntal <quimmuntal@gmail.com>2023-12-17 17:51:25 +0100
committerQuim Muntal <quimmuntal@gmail.com>2023-12-18 20:26:46 +0000
commit761e10be8805bf0b3afd015cf9f09856a6066ad2 (patch)
tree270fb91210706b8946313bcf52020c347308393f
parent450f5d90c2c85cb2b031bcf4a65c3b1467231977 (diff)
downloadgo-761e10be8805bf0b3afd015cf9f09856a6066ad2.tar.gz
go-761e10be8805bf0b3afd015cf9f09856a6066ad2.zip
cmd/link/internal/loadpe: update comment about @feat.00 symbol handling
The @feat.00 comment is outdated, as Go does support SEH on windows/amd64. While here, simplify it and add a link to the relevant documentation. Change-Id: I6e3c786ca4f4809baf46015edf569d06b12f1239 Reviewed-on: https://go-review.googlesource.com/c/go/+/550635 Reviewed-by: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Quim Muntal <quimmuntal@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
-rw-r--r--src/cmd/link/internal/loadpe/ldpe.go15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/cmd/link/internal/loadpe/ldpe.go b/src/cmd/link/internal/loadpe/ldpe.go
index e4134607c4..1ba6debb4e 100644
--- a/src/cmd/link/internal/loadpe/ldpe.go
+++ b/src/cmd/link/internal/loadpe/ldpe.go
@@ -493,17 +493,10 @@ func Load(l *loader.Loader, arch *sys.Arch, localSymVersion int, input *bio.Read
continue
}
if pesym.SectionNumber == IMAGE_SYM_ABSOLUTE && bytes.Equal(pesym.Name[:], []byte("@feat.00")) {
- // Microsoft's linker looks at whether all input objects have an empty
- // section called @feat.00. If all of them do, then it enables SEH;
- // otherwise it doesn't enable that feature. So, since around the Windows
- // XP SP2 era, most tools that make PE objects just tack on that section,
- // so that it won't gimp Microsoft's linker logic. Go doesn't support SEH,
- // so in theory, none of this really matters to us. But actually, if the
- // linker tries to ingest an object with @feat.00 -- which are produced by
- // LLVM's resource compiler, for example -- it chokes because of the
- // IMAGE_SYM_ABSOLUTE section that it doesn't know how to deal with. Since
- // @feat.00 is just a marking anyway, skip IMAGE_SYM_ABSOLUTE sections that
- // are called @feat.00.
+ // The PE documentation says that, on x86 platforms, the absolute symbol named @feat.00
+ // is used to indicate that the COFF object supports SEH.
+ // Go doesn't support SEH on windows/386, so we can ignore this symbol.
+ // See https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#the-sxdata-section
continue
}
var sect *pe.Section