|
From: | Helge Deller |
Subject: | Re: [PATCH v6 7/8] linux-user: Optimize memory layout for static and dynamic executables |
Date: | Wed, 2 Aug 2023 22:06:33 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 |
On 8/2/23 21:57, Richard Henderson wrote:
On 8/2/23 12:51, Helge Deller wrote:@@ -3159,7 +3140,7 @@ static void load_elf_image(const char *image_name, int image_fd, */ load_addr = target_mmap(loaddr, (size_t)hiaddr - loaddr + 1, PROT_NONE, MAP_PRIVATE | MAP_ANON | MAP_NORESERVE | - (ehdr->e_type == ET_EXEC ? MAP_FIXED : 0), + (is_main_executable ? MAP_FIXED : 0),This is definitely wrong, as all ET_EXEC require FIXED.Not if the PIE flag is set too...What in the world are you talking about? There is no "PIE flag" in ELF.
I probably used the wrong wording (and meant the semi-static binaries which still have e.g. klibc as interpreter)- Anyway, loadaddr defines the address already. Helge
[Prev in Thread] | Current Thread | [Next in Thread] |