Skip to content

Commit

Permalink
lguest: avoid shared libraries mapped over guest memory
Browse files Browse the repository at this point in the history
Some versions of ld.so mmap the shared libraries right in over guest
memory, so compile lguest statically by default.

[ 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 <rminnich@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Ronald G. Minnich authored and Linus Torvalds committed Aug 9, 2007
1 parent 0d027c0 commit e3bcf5e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Documentation/lguest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e3bcf5e

Please sign in to comment.