]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/internal/link: merge .pdata and .xdata sections from host object files
authorqmuntal <quimmuntal@gmail.com>
Wed, 11 Oct 2023 14:52:40 +0000 (16:52 +0200)
committerQuim Muntal <quimmuntal@gmail.com>
Thu, 9 Nov 2023 19:01:27 +0000 (19:01 +0000)
commit3aa2823d8b2c96d01980cca277f6cf7923db229f
tree975e45982a18658b737fbe8b688016b0c068734f
parent96eeb4512bd045a2c247f6ebcce46b7e443206e7
cmd/internal/link: merge .pdata and .xdata sections from host object files

The Go linker doesn't currently merge .pdata/.xdata sections from the
host object files generated by the C compiler when using internal
linking. This means that the stack can't be unwind in C -> Go.

This CL fixes that and adds a test to ensure that the stack can be
unwind in C -> Go and Go -> C transitions, which was not well tested.

Updates #57302

Change-Id: Ie86a5e6e30b80978277e66ccc2c48550e51263c8
Reviewed-on: https://go-review.googlesource.com/c/go/+/534555
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/cgo/internal/test/callback_windows.go [new file with mode: 0644]
src/cmd/cgo/internal/test/cgo_windows_test.go [new file with mode: 0644]
src/cmd/link/internal/ld/data.go
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/ld/pe.go
src/cmd/link/internal/ld/seh.go
src/cmd/link/internal/loadpe/ldpe.go
src/cmd/link/internal/loadpe/seh.go [new file with mode: 0644]