cmd/link: SDYNIMPORT with external linking produces unhandled/incorrect relocations on openbsd/amd64 #42671
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
OS-OpenBSD
Milestone
When using SDYNIMPORT with external linking on
openbsd/amd64
, unhandled/incorrect relocations are produced:The following diff "fixes" the issue:
And allows us to produce a working binary:
Without the second chunk we end up producing a binary with:
And the intermediate linker
go.o
differs as follows:In otherwords, using
SUNDEF
results inR_X86_64_PC32
that the external linker turns intoR_X86_64_JUMP_SLOT
. Without it we end up withR_X86_64_GOTPCREL
and in turnR_X86_64_GLOB_DAT
. I'm not sure if there is a better fix here - possibly an additional relocation type that needs to be handled in the amd64 linker?The text was updated successfully, but these errors were encountered: