cmd/link: "minpc or maxpc invalid" when linking with incremental linking on MSVC #64181
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
FrozenDueToAge
help wanted
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
OS-Windows
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, but it does NOT reproduce in
go1.20.6 windows/amd64
What operating system and processor architecture are you using (
go env
)?go env
OutputGo compiled from source using
GOOS=windows GOARCH=amd64
.Library compiled with
GOOS=windows GOARCH=amd64
Running on windows 64bit
What did you do?
Upgraded an existing (functional) go library from go1.20.6 to go1.21.4, compiled with
-buildmode=c-archive
.The runtime is initialised using
_rt0_amd64_windows_lib
, as described in #42190 . This part works.In MSVC's linker settings,
Enable Incremental Linking
is enabled.Disabled
Randomized Base Address
to make the dump more readable.Disabling incremental linking solves the issue.
What did you expect to see?
Library is usable, no panic on startup.
What did you see instead?
Panic on launch (full message further below).
I've dumped the disassembly of the program (using
dumpbin /disasm
) to look at these addresses.0x140028277 is part of the incremental link table that gets generated for "Enable Incremental Linking". It jumps to go:buildid
0x140046e60 is the address of the first instruction of go:buildid
Full panic message
The text was updated successfully, but these errors were encountered: