Date: Wed, 31 Oct 2001 13:43:18 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: djgpp-workers AT delorie DOT com Subject: Re: Patch for develop.txi: BSS and restarted programs In-Reply-To: <200110302002.f9UK2w421501@envy.delorie.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Tue, 30 Oct 2001, DJ Delorie wrote: > > The _real_ problem is not with the startup code. The variables in the > > BSS section are AFAIK initialized by the linker, not by the startup > > code. > > No, the stub zeros out bss at run-time. Oops, sorry for disinformation. > If you're running an unexec'd > image, the unexec should change the .bss memory range to .data so that > it acts like initialized data. That's what Emacs unexec does: it adds everything that was in .bss to .data. Otherwise, dumping would not work, since dumping effectively initializes some of the variables that were uninitialized in the original executable. That is how unexec records changes made before dumping in the dumped executable.