aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/kernel/mem.c
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2006-07-10 07:45:06 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-10 16:24:23 -0400
commit23bbd586ed7894982fd9323f63b2065afbb77773 (patch)
tree6fec4b69d2c4bafd134efc886f700654606c56fe /arch/um/kernel/mem.c
parent8633c2331e738218c7356633e1c4adb75726225f (diff)
[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>
Diffstat (limited to 'arch/um/kernel/mem.c')
-rw-r--r--arch/um/kernel/mem.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c
index 44e41a35f000..61280167c560 100644
--- a/arch/um/kernel/mem.c
+++ b/arch/um/kernel/mem.c
@@ -24,8 +24,6 @@
24#include "init.h" 24#include "init.h"
25#include "kern_constants.h" 25#include "kern_constants.h"
26 26
27extern char __binary_start;
28
29/* Changed during early boot */ 27/* Changed during early boot */
30unsigned long *empty_zero_page = NULL; 28unsigned long *empty_zero_page = NULL;
31unsigned long *empty_bad_page = NULL; 29unsigned long *empty_bad_page = NULL;
@@ -65,8 +63,6 @@ static void setup_highmem(unsigned long highmem_start,
65 63
66void mem_init(void) 64void mem_init(void)
67{ 65{
68 unsigned long start;
69
70 max_low_pfn = (high_physmem - uml_physmem) >> PAGE_SHIFT; 66 max_low_pfn = (high_physmem - uml_physmem) >> PAGE_SHIFT;
71 67
72 /* clear the zero-page */ 68 /* clear the zero-page */
@@ -81,13 +77,6 @@ void mem_init(void)
81 free_bootmem(__pa(brk_end), uml_reserved - brk_end); 77 free_bootmem(__pa(brk_end), uml_reserved - brk_end);
82 uml_reserved = brk_end; 78 uml_reserved = brk_end;
83 79
84 /* Fill in any hole at the start of the binary */
85 start = (unsigned long) &__binary_start & PAGE_MASK;
86 if(uml_physmem != start){
87 map_memory(uml_physmem, __pa(uml_physmem), start - uml_physmem,
88 1, 1, 0);
89 }
90
91 /* this will put all low memory onto the freelists */ 80 /* this will put all low memory onto the freelists */
92 totalram_pages = free_all_bootmem(); 81 totalram_pages = free_all_bootmem();
93 totalhigh_pages = highmem >> PAGE_SHIFT; 82 totalhigh_pages = highmem >> PAGE_SHIFT;