On 08/06/2023 18:40, Martin Frb via fpc-devel wrote:
It seems that on Cocoa an exe is by default relocatable.
At least a basic test shows that dumping a stack at runtime for each run
(no new compile) gives new addresses.
Fpc 3.2.2
Is there a way to turn this off? (some flag to pass to the linker?)
It's not called relocation, but address space layout randomization
(ASLR). You can disable it by compiling/linking your binary with -k-no_pie
Alternatively, you can launch a program via posix_spawnp using a custom
attribute to disable ASLR for just that invocation. See e.g. main.c at
https://github.com/svlobanov/disable-aslr-on-mac
Jonas
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel