|
From: Tom H. <th...@cy...> - 2004-07-27 17:33:28
|
In message <8e1...@lo...>
Tom Hughes <th...@cy...> wrote:
> In message <109...@ix...>
> Jeremy Fitzhardinge <je...@go...> wrote:
>
> > I bet the distinction between the groups of values is that some are
> > initialized in the source, and some are not (ie, expected to default to
> > 0/NULL).
>
> I think this may be the problem - the code to zero pad from filesz
> to memsz looks highly odd to me. Specifically where it works out the
> value of "bytes" which is the amount of memory it zeros.
This is the problem, and it is alignment related. When the odd bit
at the end of the mapping from the file is zero filled it only fills
up to the next page boundary instead of up to the alignment boundary
given in the header.
On x86-32 it happens to work because the alignment in the header is
normally the same as the page size, but x86-64 seems to be using an
alignment of 1Mb for some reason.
The attached patch should fix it.
That said, the map output that Nick sent from when stage2 was launched
directly makes it look like the OS was only round to page boundaries
anyway!
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|