Subject: Re: bug#23529: Request for fixing randomize_va_space build issues

From: Paul Eggert <[email-masked]>
Date: Wed, 7 Sep 2016 10:40:14 -0700

Eli Zaretskii wrote:
>> PIE can relocate data as well as code.
> Since we will be reading data into existing variables, that would
> happen automatically.

I'm afraid I'm not following. Any existing variables (i.e., existing in Emacs 
when it starts up) are of fixed size, so they can't hold all the data of a 
dumped Emacs. The newly starting-up Emacs must decide how much storage to 
allocate to hold the dumped state that Emacs is about to read.  This storage's 
addresses should be randomized, and the data that Emacs reads will contain 
pointers-to-data that Emacs itself would need to relocate.

All this is doable, of course. It's just that it should be easier and more 
portable to use the existing compilers and linkers rather than reinvent the wheel.

>> > And with modules, we also have code to dump.
> ??? What do you mean by that?  Modules cannot be preloaded, AFAIK.

You're right, saving objects as C source code doesn't fix that problem all by 
itself.