Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mlton-script: OpenBSD link-opt for no xonly text
Add a `-target-link-opt` for OpenBSD that disables "xonly" text. OpenBSD's linker, by default, makes a program's text segment executable-only ("xonly"): that is, executable but not readable. However, MLton needs to be able to read the text segment when mapping return addresses to stack frame indices, possibly among other things. This causes programs compiled with MLton's native code generator to fault and die with `SIGSEGV`. However, the default "xonly" behavior can be disabled with a linker option (`--no-execute-only`), so we can turn it off with a `-target-link-opt` specific to OpenBSD in `mlton-script`. Binaries built in this configuration run as expected. Fixes #538 Signed-off-by: Dan Cross <cross@gajendra.net>
- Loading branch information