[compiler-rt] [compiler-rt] Add CMake option to enable execute-only code generation on AArch64 (PR #140555)
Csanád Hajdú via llvm-commits
llvm-commits at lists.llvm.org
Mon May 19 08:54:57 PDT 2025
Il-Capitano wrote:
> I don't think that this properly handles MachO.
Can you expand on this more? MachO doesn't have execute-only code AFAIK. This is intended for AArch64 ELF targets only.
> Additionally, I don't understand the need for the `unique` flag on the section, nor the section id (`0`).
`unique,0` is needed because the assembler creates an implicit `.text` section with default flags. If we tried to just do `.section .text,"axy"`, we'd get the following error: `error: changed section flags for .text, expected: 0x6`. So the execute-only `.text` section needs to be different from the implicit `.text` section. The id `0` is arbitrary, but we need to provide something anyways.
This also matches what LLVM outputs when it generates execute-only code: https://godbolt.org/z/a8xa7qsxG
https://github.com/llvm/llvm-project/pull/140555
More information about the llvm-commits
mailing list