[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

@ -7,13 +7,16 @@ jiffies = jiffies_64;
SECTIONS
{
/*This must contain the right address - not quite the default ELF one.*/
/* This must contain the right address - not quite the default ELF one.*/
PROVIDE (__executable_start = START);
. = START + SIZEOF_HEADERS;
/* Static binaries stick stuff here, like the sigreturn trampoline,
* invisibly to objdump. So, just make __binary_start equal to the very
* beginning of the executable, and if there are unmapped pages after this,
* they are forever unusable.
*/
__binary_start = START;
/* Used in arch/um/kernel/mem.c. Any memory between START and __binary_start
* is remapped.*/
__binary_start = .;
. = START + SIZEOF_HEADERS;
#ifdef MODE_TT
.remap_data : { UNMAP_PATH (.data .bss) }