[PATCH] uml: fix static binary segfault

When UML is built as a static binary, it segfaults when run.  The reason is
that a memory hole that is present in dynamic binaries isn't there in static
binaries, and it contains essential stuff.

This fix removes the code which maps some anonymous memory into that hole and
cleans up some related code.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Jeff Dike
2006-07-10 04:45:06 -07:00
committed by Linus Torvalds
parent 8633c2331e
commit 23bbd586ed
8 changed files with 28 additions and 34 deletions

View File

@ -330,6 +330,8 @@ EXPORT_SYMBOL(end_iomem);
#define MIN_VMALLOC (32 * 1024 * 1024)
extern char __binary_start;
int linux_main(int argc, char **argv)
{
unsigned long avail, diff;
@ -374,8 +376,9 @@ int linux_main(int argc, char **argv)
printf("UML running in %s mode\n", mode);
uml_start = CHOOSE_MODE_PROC(set_task_sizes_tt, set_task_sizes_skas,
&host_task_size, &task_size);
uml_start = (unsigned long) &__binary_start;
host_task_size = CHOOSE_MODE_PROC(set_task_sizes_tt,
set_task_sizes_skas, &task_size);
/*
* Setting up handlers to 'sig_info' struct
@ -395,7 +398,7 @@ int linux_main(int argc, char **argv)
physmem_size += UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end);
}
uml_physmem = uml_start;
uml_physmem = uml_start & PAGE_MASK;
/* Reserve up to 4M after the current brk */
uml_reserved = ROUND_4M(brk_start) + (1 << 22);