From ee9c8ddfbe2de2d6e62cd063a269db6446ca7faf Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 16 Aug 2021 12:05:51 +0200 Subject: exec: Fix and use mask for memory layout Gnumach's 0650a4ee30e3 implements support for high bits being set in the mask parameter of vm_map. This allowed to remove the rmh kludge in the dynamic linker. Exec now can and should use the mask for excluding parts of the memory layout. --- exec/exec.c | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'exec/exec.c') diff --git a/exec/exec.c b/exec/exec.c index 617dc8e8..d72ad886 100644 --- a/exec/exec.c +++ b/exec/exec.c @@ -81,26 +81,13 @@ load_section (void *section, struct execdata *u) addr += u->info.elf.loadbase; else { -#if 0 - /* XXX: gnumach currently does not support high bits set in mask to prevent - * loading at high addresses. - * Instead, in rtld we prevent mappings there through a huge mapping done by - * fmh(). - */ - switch (elf_machine) - { - case EM_386: - case EM_486: - /* On the i386, programs normally load at 0x08000000, and - expect their data segment to be able to grow dynamically - upward from its start near that address. We need to make - sure that the dynamic linker is not mapped in a conflicting - address. */ - /* mask = 0xf8000000UL; */ /* XXX */ - break; - default: - break; - } +#ifdef __i386__ + /* On the i386, programs normally load at 0x08000000, and + expect their data segment to be able to grow dynamically + upward from its start near that address. We need to make + sure that the dynamic linker is not mapped in a conflicting + address. */ + mask = 0xf0000000UL; /* XXX */ #endif } if (anywhere && addr < vm_page_size) -- cgit v1.2.3