Open 4a6f656c opened 1 year ago
@golang/compiler
Change https://go.dev/cl/484555 mentions this issue: cmd/link/internal/ld: disable execute-only for external linking on openbsd/arm64
I know of one place where we read instruction memory, to print instruction bytes after a SIGILL:
https://cs.opensource.google/go/go/+/refs/tags/go1.20.3:src/runtime/signal_unix.go;l=747
Not super critical, but if we're running in execute-only mode it would be good to disable that code.
since it stores constants in the text section rather than in rodata, which it then reads during execution.
Do you mean literal pool ?
since it stores constants in the text section rather than in rodata, which it then reads during execution.
Do you mean literal pool ?
Yes.
Change https://go.dev/cl/512538 mentions this issue: cmd/internal/obj/arm64: improve classification of loads and stores
Change https://go.dev/cl/512540 mentions this issue: cmd/internal/obj/arm64: improve splitting of 24 bit unsigned scaled immediates
Change https://go.dev/cl/512539 mentions this issue: cmd/internal/obj/arm64: avoid unnecessary literal pool usage for moves
Change https://go.dev/cl/515617 mentions this issue: cmd/internal/obj/arm64: load large constants into vector registers from rodata
Change https://go.dev/cl/515615 mentions this issue: cmd/internal/obj/arm64: avoid unnecessary pool literal usage for load/store pairs
The Go assembler for arm64 generates code that is not execute-only compatible, since it stores constants in the text section rather than in rodata, which it then reads during execution.
OpenBSD 7.3 has enabled xonly by default on OpenBSD/arm64 - this means that externally linked Go binaries segfault on execution. This can be worked around in the interim by disabling execute-only when the external linker is invoked.
Longer term, the assembler should store constants in rodata and/or load them via instructions, such that the text section can be marked as execute-only.