summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2021-08-16 12:05:51 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2021-08-16 12:05:51 +0200
commitee9c8ddfbe2de2d6e62cd063a269db6446ca7faf (patch)
treee657bdbb2a59169c46f2c64ff6036f73b97f2669
parented5090bde7497850a6ea654e8308496d518010e3 (diff)
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.
-rw-r--r--exec/exec.c27
1 files changed, 7 insertions, 20 deletions
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)