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

Reply via email to