2007-08-09 11:08:04

by Rusty Russell

[permalink] [raw]
Subject: [PATCH] ld.so on FC7 is mmap'ing shared libraries right in over guest memory.

From: Ronald G. Minnich <[email protected]>

[ FC7 maps shared libraries very low, where the launcher maps guest's
physical memory. Quick fix is to link Launcher static, real fix is for
2.6.24. ]

-static is a simple fix. I expect this problem will be more common than we
like, as different distro's make different "improvements" to ld.so

Signed-off-by: Ronald G. Minnich <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>

diff --git a/Documentation/lguest/Makefile b/Documentation/lguest/Makefile
index 31e794e..60136d8 100644
--- a/Documentation/lguest/Makefile
+++ b/Documentation/lguest/Makefile
@@ -13,7 +13,9 @@ LGUEST_GUEST_TOP := ($(CONFIG_PAGE_OFFSET) - 0x08000000)

CFLAGS:=-Wall -Wmissing-declarations -Wmissing-prototypes -O3 -Wl,-T,lguest.lds
LDLIBS:=-lz
-
+# Removing this works for some versions of ld.so (eg. Ubuntu Feisty) and
+# not others (eg. FC7).
+LDFLAGS+=-static
all: lguest.lds lguest

# The linker script on x86 is so complex the only way of creating one



2007-08-09 14:51:08

by Arjan van de Ven

[permalink] [raw]
Subject: Re: [PATCH] ld.so on FC7 is mmap'ing shared libraries right in over guest memory.

On Thu, 2007-08-09 at 21:07 +1000, Rusty Russell wrote:
> From: Ronald G. Minnich <[email protected]>
>
> [ FC7 maps shared libraries very low, where the launcher maps guest's
> physical memory. Quick fix is to link Launcher static, real fix is for
> 2.6.24. ]
>
> -static is a simple fix. I expect this problem will be more common than we
> like, as different distro's make different "improvements" to ld.so


this description is incorrect; it's not an ld.so change that causes the
low mapping.

It's a command line option to the prelink program (which is in most
distributions) that makes it use the entire address space, not just the
higher bits....



2007-08-10 16:35:41

by ron minnich

[permalink] [raw]
Subject: Re: [PATCH] ld.so on FC7 is mmap'ing shared libraries right in over guest memory.

On 8/9/07, Arjan van de Ven <[email protected]> wrote:
> On Thu, 2007-08-09 at 21:07 +1000, Rusty Russell wrote:
> > From: Ronald G. Minnich <[email protected]>
> >
> > [ FC7 maps shared libraries very low, where the launcher maps guest's
> > physical memory. Quick fix is to link Launcher static, real fix is for
> > 2.6.24. ]
> >
> > -static is a simple fix. I expect this problem will be more common than we
> > like, as different distro's make different "improvements" to ld.so
>
>
> this description is incorrect; it's not an ld.so change that causes the
> low mapping.
>
> It's a command line option to the prelink program (which is in most
> distributions) that makes it use the entire address space, not just the
> higher bits....

oops. That'll teach me.

Thanks for the correction :-)

ron