]> Cypherpunks repositories - gostls13.git/commit
cmd/link/internal/loadpe: fix .xdata unwind info parsing
authorDavis Goodin <dagood@microsoft.com>
Wed, 22 Nov 2023 01:12:48 +0000 (17:12 -0800)
committerQuim Muntal <quimmuntal@gmail.com>
Wed, 22 Nov 2023 16:20:28 +0000 (16:20 +0000)
commitd4430f6913b0eacb662a69884d12850864616c37
treefbd9554aa42875ea14286a51aba6563bd29c93ab
parent37971b31dfde1b9c40f6d42484e528c17450a9ae
cmd/link/internal/loadpe: fix .xdata unwind info parsing

Unwind info in .xdata was being parsed incorrectly, causing targetOff to
be incorrect and miss finding data in .xdata that it should have found.
This causes a linker issue when using the MinGW MSVCRT compiler.

Contains several fixes based on the exception handling docs: the offset
used to get the number of unwind codes, the calculation of the target
offset based on the dynamic size of the unwind data, and the
UNW_FLAG_CHAININFO flag's value.

Fixes #64200

Change-Id: I6483d921b2bf8a2512a95223bf3c8ce8bc63dc4a
Reviewed-on: https://go-review.googlesource.com/c/go/+/544415
TryBot-Result: Gopher Robot <gobot@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
Run-TryBot: Quim Muntal <quimmuntal@gmail.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/cmd/link/internal/loadpe/seh.go