[Lguest] mercurial repo

ron minnich rminnich at gmail.com
Tue Jul 31 01:55:42 EST 2007


Ok, my problem on FC7 is that ld.so is mapping libc at low memory. The
second mmap is mapping /dev/zero over that area, as we ask it to. So,
the mmap happens, and libc kind of goes away and is replaced by zeros
... this is "bad". How to get ld.so to map "up there"? Is this a
Fedora Core-ism at work? I have seen no other reports of this problem.

My fix is
LDFLAGS+=-static

in lguest Makefile. Patch attached. Ugly, no? This patch also includes
the  'read elf section in if mmap fails" which now lets me boot plan 9
until it hits the 0x40 GPF.

Note that my fix is pretty simple. Ask kernel to mmap, if kernel does
not mmap, well, then try to read section in. I could get all fancy and
check for nonaligned sections etc. myself but, hey, that's the
kernel's job (or, much to my surprise, it seems libc thinks it is also
libc's job..., as revealed by stepi, but that just makes me less
inclined to add my own checking, on top of the two layers of checking
already there).

ron
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-ld.so-on-FC7-is-mmap-ing-shared-libraries-right-in-o.patch
Type: application/octet-stream
Size: 3249 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/lguest/attachments/20070730/9921abf6/attachment.obj>


More information about the Lguest mailing list