[PLUG] Emacs

Russell Senior seniorr at aracnet.com
Thu May 16 00:24:08 UTC 2002


>>>>> "Galen" == Galen Seitz <galens at seitzassoc.com> writes:

Galen> I suspect this is ancient history at this point, but I can tell
Galen> you that it used to be quite interesting porting emacs to a new
Galen> architecture.  During the build process, a minimal version of
Galen> emacs would be run after it had been linked.  At that point,
Galen> the core lisp code would get loaded into memory.  This lisp
Galen> code would be located in the data or bss section (my memory is
Galen> a bit fuzzy here).  Then emacs would play some very tricky
Galen> games by calling a function named 'unexec'.  This would alter
Galen> the section boundaries such that the just loaded lisp code
Galen> would be merged into the text section.  Then the image was
Galen> written to disk to create your new emacs executable.

Unexec is still used as far as I can tell.  See for example the Emacs
function dump-emacs.  C-h f tells me this:

   dump-emacs is a built-in function.
   (dump-emacs FILENAME SYMFILE)

   Dump current state of Emacs into executable file FILENAME.
   Take symbols from SYMFILE (presumably the file you executed to run Emacs).
   This is used in the file `loadup.el' when building Emacs.

   You must run Emacs in batch mode in order to dump it.

I think several other common programs use this technique.  I am pretty
sure Perl at least used to be one of them.


-- 
Russell Senior         ``The two chiefs turned to each other.        
seniorr at aracnet.com      Bellison uncorked a flood of horrible       
                         profanity, which, translated meant, `This is
                         extremely unusual.' ''                      




More information about the PLUG mailing list