In SCM, the ability to save running program images is called dump
(see Dump). In order to make
dump available to SCM, build
with feature ‘dump’.
dumped executables are compatible with
Most of the code for dump is taken from emacs-19.34/src/unex*.c. No modifications to the emacs source code were required to use unexelf.c. Dump has not been ported to all platforms. If unexec.c or unexelf.c don't work for you, try using the appropriate unex*.c file from emacs.
The ‘dscm4’ and ‘dscm5’ targets in the SCM Makefile save images from udscm4 and udscm5 executables respectively.
Address space layout randomization interferes with
Here are the fixes for various operating-systems:
Override by adding the following to udscm5.opt:
echo 0 > /proc/sys/kernel/randomize_va_space
before dumping. Makefile has this randomize_va_space
stuffing scripted for targets ‘dscm4’ and ‘dscm5’. You must
either set randomize_va_space to 0 or run as root to dump.
Causes dyld to not randomize the load addresses of images in a process where the main executable was built position independent. This can be helpful when trying to reproduce and debug a problem in a PIE.