You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cmd/asm: arm64 assembler generates code that is not execute-only compatible #59615
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.
Activity
dr2chase commentedon Apr 13, 2023
@golang/compiler
gopherbot commentedon Apr 13, 2023
Change https://go.dev/cl/484555 mentions this issue:
cmd/link/internal/ld: disable execute-only for external linking on openbsd/arm64randall77 commentedon Apr 13, 2023
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.
erifan commentedon Apr 14, 2023
Do you mean literal pool ?
4a6f656c commentedon Apr 14, 2023
Yes.
cmd/link/internal/ld: disable execute-only for external linking on op…
gopherbot commentedon Jul 24, 2023
Change https://go.dev/cl/512538 mentions this issue:
cmd/internal/obj/arm64: improve classification of loads and storesgopherbot commentedon Jul 24, 2023
Change https://go.dev/cl/512540 mentions this issue:
cmd/internal/obj/arm64: improve splitting of 24 bit unsigned scaled immediatesgopherbot commentedon Jul 24, 2023
Change https://go.dev/cl/512539 mentions this issue:
cmd/internal/obj/arm64: avoid unnecessary literal pool usage for movescmd/internal/obj/arm64: improve classification of loads and stores
cmd/internal/obj/arm64: avoid unnecessary literal pool usage for moves
cmd/internal/obj/arm64: improve splitting of 24 bit unsigned scaled i…
gopherbot commentedon Aug 3, 2023
Change https://go.dev/cl/515617 mentions this issue:
cmd/internal/obj/arm64: load large constants into vector registers from rodatagopherbot commentedon Aug 3, 2023
Change https://go.dev/cl/515615 mentions this issue:
cmd/internal/obj/arm64: avoid unnecessary pool literal usage for load/store pairscmd/internal/obj/arm64: load large constants into vector registers fr…
cmd/internal/obj/arm64: avoid unnecessary pool literal usage for load…