diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2023-08-02 15:17:33 -0700 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2023-08-08 13:27:15 -0700 |
commit | da2b71fab63f2396396021917eed9d52f33a45c0 (patch) | |
tree | 59f4b4fde6d99cb6e61f81bf40832ec344716a1f /linux-user/user-mmap.h | |
parent | 2d708164e0475064e0e2167bd73e8570e22df1e0 (diff) |
linux-user: Define ELF_ET_DYN_BASE in $guest/target_mman.h
Copy each guest kernel's default value, then bound it
against reserved_va or the host address space.
Tested-by: Helge Deller <deller@gmx.de>
Reviewed-by: Helge Deller <deller@gmx.de>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'linux-user/user-mmap.h')
-rw-r--r-- | linux-user/user-mmap.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/linux-user/user-mmap.h b/linux-user/user-mmap.h index f844ba4e61..0f4883eb57 100644 --- a/linux-user/user-mmap.h +++ b/linux-user/user-mmap.h @@ -25,10 +25,19 @@ * TASK_UNMAPPED_BASE: For mmap without hint (addr != 0), the search * for unused virtual memory begins at TASK_UNMAPPED_BASE. * - * task_unmapped_base: When the guest address space is limited via -R, - * the value of TASK_UNMAPPED_BASE is adjusted to fit. + * ELF_ET_DYN_BASE: When the executable is ET_DYN (i.e. PIE), and requires + * an interpreter (i.e. not -static-pie), use ELF_ET_DYN_BASE instead of + * TASK_UNMAPPED_BASE for selecting the address of the executable. + * This provides some distance between the executable and the interpreter, + * which allows the initial brk to be placed immediately after the + * executable and also have room to grow. + * + * task_unmapped_base, elf_et_dyn_base: When the guest address space is + * limited via -R, the values of TASK_UNMAPPED_BASE and ELF_ET_DYN_BASE + * must be adjusted to fit. */ extern abi_ulong task_unmapped_base; +extern abi_ulong elf_et_dyn_base; /* * mmap_next_start: The base address for the next mmap without hint, |