ld64 segprot on MacOS Catalina not working?
问题 I want to create a binary on MacOS Catalina (64 bit) with a data segment that can be made executable (see here for details) but is not executable from the start. I make my binary with gcc -nostdlib -segprot __DATA rwx rw- .... I also created an object file with gcc and then called ld directly. The ld version is $ ld -v @(#)PROGRAM:ld PROJECT:ld64-530 BUILD 18:57:17 Dec 13 2019 configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m