www.delorie.com/djgpp/bugs/show.cgi   search  
Bug 000028

When Created: 10/14/1995 16:21:00
Against DJGPP version: 2.00.beta3
By whom: dpsm@en.com
Abstract: Dumping EMACS and clearing .bss
DJGPP always clears the .bss segment on startup.

This defeats the dump that Emacs does.  The first time Emacs is run,
it reads in lots of elisp and initializes lots of data.  It then writes
out a new COFF file with a larger .data segment (it includes the original
.bss segment).  The new executable has a pre-initalized .bss segment.

I suspect that most loaders are responsible for clearing the .bss segment,
while it happens all the time in djgpp.


I have tried modifying crt0.s so that it does not clear .bss if it is
already initialized, but there are other problems like exception handlers.

Note added: 10/21/1995 12:44:38
By whom: sandmann@clio.rice.edu
crt0 clears from the start point "edata" to the end point "end" both
of which are defined at link time.  When emacs writes a new image,
any code which references these symbols will not work correctly.  So,
this is really an emacs bug when it assumes that re-writing the image
would be an adequate way to take this short cut.  I suspect if you 
use a custom linker script when originally building the image you
might be able to avoid this problem if there were no BSS section,
but that's just a guess.

Note added: 11/12/1995 20:41:57
By whom: dj@delorie.com
I've partially fixed this - the stub now does the clearing, and
libc doesn't, but there are going to be some problems in libc
where bss is expected to be zero to initialize properly.

Closed on 01/23/1996 21:47:08: Mostly fixed; emacs seems to work. Still some libc functions that need fixing, though.
By whom: dj@delorie.com

Solution added: 06/13/1996 09:12:37
By whom: eliz@is.elta.co.il
Emacs 19.31 can be compiled with DJGPP v2.0.  There are 2 known library
bugs that affect running programs under Emacs and shelling to DOS:

   the bug in `_is_executable' function
   the bug in `sigaction' function

For smooth operation, these should be fixed and Emacs rebuilt with the
patched library.  Other than that, there are no known DJGPP-specific
problems with Emacs.



  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2010   by DJ Delorie     Updated Jul 2010