This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Unexec gurus?


"Greg J. Badros" <gjb@cs.washington.edu> writes:

> Now my question becomes:  is it a fundamental weakness of unexec/dump
> that all code must be statically linked in order to preserve state?
> This seems a little counterintuitive because I'd've thought that the
> data segments could still be preserved.  

If the library is upgraded in a backwards-compatible way (e.g., minor
version number change, maybe some compile-time options changed or
routines added, but code using old ABI still works), it's still
allowed to rearrange how and where it keeps its internal state that
isn't exposed through the API.  Even recompiling from the same source
code can alter the layout, for example, by invalidating private
function pointers.

It's also possible that on some systems, the library load address may
vary from one process to another.  Even if it doesn't vary between
processes, it could change when some other library is updated and has
a different size.  You'd need to do relocation processing for any
saved data from that library, even if it hadn't been updated.

So, yes, I'd say either you link statically, or you plan to completely
reinitialize that library when you start the dumped executable;
anything else is unsafe.

Ken

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]