Make mckernel/kernel/host.c set proc->vm->region.brk_start to

(USER_END / 4) & LARGE_PAGE_MASK
so that brk won't destroy .bss section when
using debug-mode of ld.so to link shared objects.
This commit is contained in:
Masamichi Takagi m-takagi@ab.jp.nec.com
2013-05-29 17:08:36 +09:00
parent d540deab17
commit d70dd2338c

View File

@@ -176,8 +176,23 @@ static int process_msg_prepare_process(unsigned long rphys)
}
}
#if 1
/*
Fix for the problem where brk grows to hit .bss section
when using dynamically linked executables.
Test code resides in /home/takagi/project/mpich/src/brk_icc_mic.
This is because when using
ld.so (i.e. using shared objects), mckernel/kernel/host.c sets "brk" to
the end of .bss of ld.so (e.g. 0x21f000), and then ld.so places a
main-program after this (e.g. 0x400000), so "brk" will hit .bss
eventually.
*/
proc->vm->region.brk_start = proc->vm->region.brk_end =
(USER_END / 4) & LARGE_PAGE_MASK;
#else
proc->vm->region.brk_start = proc->vm->region.brk_end =
proc->vm->region.data_end;
#endif
proc->vm->region.map_start = proc->vm->region.map_end =
(USER_END / 3) & LARGE_PAGE_MASK;