/ go Public
cmd/link: wrong program header offset when cross-compile to riscv64 when setting -T text alignment #57983
Issues solely affecting the riscv64 architecture.
Issues related to the Go compiler and/or runtime.
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
What version of Go are you using (
Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
What did you do?
I try to cross-compile an empty main function to RISC-V binary with the following command, trying to put text segment to 0x80200000:
kmain is a directory containing a main.go with only an empty main func and nothing imports.
After executing, I tried to
readelf -a kernel.elf, it says 'readelf: Error: the PHDR segment is not covered by a LOAD segment'. And the output program headers like:
The offset of the third section is pretty big and cannot be loaded.
When I change GOARCH to 'amd64' or delete -T, nothing above happens: none error and offset is also fine.
What did you expect to see?
none error and offsets of program headers is fine.
What did you see instead?
error and strangely big offset
The text was updated successfully, but these errors were encountered: