I have a program that generates self-modifying code (see https://tigress.wtf/selfModify.html in case you're interested). It runs on x86 Darwin and Linux. On Darwin, I compile with
gcc -g -segprot __TEXT rwx rwx self_modifying.c -o self_modifying.exe
Recently, this seems not to work, I get
dyld: malformed mach-o image: __TEXT segment maps start of file but is writable
when I run the program.
I'm running clang version 6.0.1 on MacOS 10.15.3. Any help would be appreciated.