> This is something we have to define.  Currently we only complain if one
> of the defined functions that was dumped cannot be found in the new
> .eln.  My preference would be to sign each .eln used for dump to make
> sure what we are loading is what we dumped and refuse to load otherwise.

What if we find out where the linker has put the shared library, copy that region
of memory into the dump file and when loading Emacs we mmap that data into
same address it was?
It is essentially saving the result of the linker for later use. This would require
no ASLR and doing it ASAP to prevent the something from using that address space.

Another option: statically link the .eln files (we'd need libgccjit to create static libraries)
into the final Emacs executable. This would take care of function definitions and
loading the dump would take care of the rest.

Nicolas