diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2021-12-31 18:17:40 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2021-12-31 18:22:46 +0100 |
commit | 8c0727af63198661c0ae3641a9d66609021754a7 (patch) | |
tree | d083dd8ed37aa5eab36aebaf64447fd381ab4a1f /sysdeps/mach | |
parent | 1f17da01e64efba97c0d39e2b3d01c8034b6db5a (diff) | |
download | glibc-8c0727af63198661c0ae3641a9d66609021754a7.zip glibc-8c0727af63198661c0ae3641a9d66609021754a7.tar.gz glibc-8c0727af63198661c0ae3641a9d66609021754a7.tar.bz2 |
hurd: Avoid overzealous shared objects constraints
407765e9f24f ("hurd: Fix ELF_MACHINE_USER_ADDRESS_MASK value") switched
ELF_MACHINE_USER_ADDRESS_MASK from 0xf8000000UL to 0xf0000000UL to let
libraries etc. get loaded at 0x08000000. But
ELF_MACHINE_USER_ADDRESS_MASK is actually only meaningful for the main
program anyway, so keep it at 0xf8000000UL to prevent the program loader
from putting ld.so beyond 0x08000000. And conversely, drop the use of
ELF_MACHINE_USER_ADDRESS_MASK for shared objects, which don't need any
constraints since the program will have already be loaded by then.
Diffstat (limited to 'sysdeps/mach')
-rw-r--r-- | sysdeps/mach/hurd/dl-sysdep.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c index 968a58f..b1a151a 100644 --- a/sysdeps/mach/hurd/dl-sysdep.c +++ b/sysdeps/mach/hurd/dl-sysdep.c @@ -476,7 +476,7 @@ __mmap (void *addr, size_t len, int prot, int flags, int fd, off_t offset) mapaddr = (vm_address_t) addr; err = __vm_map (__mach_task_self (), - &mapaddr, (vm_size_t) len, ELF_MACHINE_USER_ADDRESS_MASK, + &mapaddr, (vm_size_t) len, 0, !(flags & MAP_FIXED), memobj_rd, (vm_offset_t) offset, @@ -491,7 +491,7 @@ __mmap (void *addr, size_t len, int prot, int flags, int fd, off_t offset) if (! err) err = __vm_map (__mach_task_self (), &mapaddr, (vm_size_t) len, - ELF_MACHINE_USER_ADDRESS_MASK, + 0, !(flags & MAP_FIXED), memobj_rd, (vm_offset_t) offset, flags & (MAP_COPY|MAP_PRIVATE), |