Skip to content

Commit

Permalink
linux-user: Remove ELF_START_MMAP and image_info.start_mmap
Browse files Browse the repository at this point in the history
The start_mmap value is write-only.
Remove the field and the defines that populated it.
Logically, this has been replaced by task_unmapped_base.

Tested-by: Helge Deller <deller@gmx.de>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Sep 1, 2023
1 parent 6467d9e commit f6d4554
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 39 deletions.
38 changes: 0 additions & 38 deletions linux-user/elfload.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,6 @@ static uint32_t get_elf_hwcap(void)
}

#ifdef TARGET_X86_64
#define ELF_START_MMAP 0x2aaaaab000ULL

#define ELF_CLASS ELFCLASS64
#define ELF_ARCH EM_X86_64

Expand Down Expand Up @@ -221,8 +219,6 @@ static bool init_guest_commpage(void)
#endif
#else

#define ELF_START_MMAP 0x80000000

/*
* This is used to ensure we don't load something for the wrong architecture.
*/
Expand Down Expand Up @@ -308,8 +304,6 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUX86State *en
#ifndef TARGET_AARCH64
/* 32 bit ARM definitions */

#define ELF_START_MMAP 0x80000000

#define ELF_ARCH EM_ARM
#define ELF_CLASS ELFCLASS32
#define EXSTACK_DEFAULT true
Expand Down Expand Up @@ -600,7 +594,6 @@ static const char *get_elf_platform(void)

#else
/* 64 bit ARM definitions */
#define ELF_START_MMAP 0x80000000

#define ELF_ARCH EM_AARCH64
#define ELF_CLASS ELFCLASS64
Expand Down Expand Up @@ -871,7 +864,6 @@ const char *elf_hwcap2_str(uint32_t bit)
#ifdef TARGET_SPARC
#ifdef TARGET_SPARC64

#define ELF_START_MMAP 0x80000000
#define ELF_HWCAP (HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR | HWCAP_SPARC_SWAP \
| HWCAP_SPARC_MULDIV | HWCAP_SPARC_V9)
#ifndef TARGET_ABI32
Expand All @@ -883,7 +875,6 @@ const char *elf_hwcap2_str(uint32_t bit)
#define ELF_CLASS ELFCLASS64
#define ELF_ARCH EM_SPARCV9
#else
#define ELF_START_MMAP 0x80000000
#define ELF_HWCAP (HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR | HWCAP_SPARC_SWAP \
| HWCAP_SPARC_MULDIV)
#define ELF_CLASS ELFCLASS32
Expand All @@ -905,7 +896,6 @@ static inline void init_thread(struct target_pt_regs *regs,
#ifdef TARGET_PPC

#define ELF_MACHINE PPC_ELF_MACHINE
#define ELF_START_MMAP 0x80000000

#if defined(TARGET_PPC64)

Expand Down Expand Up @@ -1108,8 +1098,6 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUPPCState *en

#ifdef TARGET_LOONGARCH64

#define ELF_START_MMAP 0x80000000

#define ELF_CLASS ELFCLASS64
#define ELF_ARCH EM_LOONGARCH
#define EXSTACK_DEFAULT true
Expand Down Expand Up @@ -1200,8 +1188,6 @@ static uint32_t get_elf_hwcap(void)

#ifdef TARGET_MIPS

#define ELF_START_MMAP 0x80000000

#ifdef TARGET_MIPS64
#define ELF_CLASS ELFCLASS64
#else
Expand Down Expand Up @@ -1359,8 +1345,6 @@ static uint32_t get_elf_hwcap(void)

#ifdef TARGET_MICROBLAZE

#define ELF_START_MMAP 0x80000000

#define elf_check_arch(x) ( (x) == EM_MICROBLAZE || (x) == EM_MICROBLAZE_OLD)

#define ELF_CLASS ELFCLASS32
Expand Down Expand Up @@ -1401,8 +1385,6 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUMBState *env

#ifdef TARGET_NIOS2

#define ELF_START_MMAP 0x80000000

#define elf_check_arch(x) ((x) == EM_ALTERA_NIOS2)

#define ELF_CLASS ELFCLASS32
Expand Down Expand Up @@ -1498,8 +1480,6 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs,

#ifdef TARGET_OPENRISC

#define ELF_START_MMAP 0x08000000

#define ELF_ARCH EM_OPENRISC
#define ELF_CLASS ELFCLASS32
#define ELF_DATA ELFDATA2MSB
Expand Down Expand Up @@ -1536,8 +1516,6 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs,

#ifdef TARGET_SH4

#define ELF_START_MMAP 0x80000000

#define ELF_CLASS ELFCLASS32
#define ELF_ARCH EM_SH

Expand Down Expand Up @@ -1618,8 +1596,6 @@ static uint32_t get_elf_hwcap(void)

#ifdef TARGET_CRIS

#define ELF_START_MMAP 0x80000000

#define ELF_CLASS ELFCLASS32
#define ELF_ARCH EM_CRIS

Expand All @@ -1635,8 +1611,6 @@ static inline void init_thread(struct target_pt_regs *regs,

#ifdef TARGET_M68K

#define ELF_START_MMAP 0x80000000

#define ELF_CLASS ELFCLASS32
#define ELF_ARCH EM_68K

Expand Down Expand Up @@ -1686,8 +1660,6 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUM68KState *e

#ifdef TARGET_ALPHA

#define ELF_START_MMAP (0x30000000000ULL)

#define ELF_CLASS ELFCLASS64
#define ELF_ARCH EM_ALPHA

Expand All @@ -1705,8 +1677,6 @@ static inline void init_thread(struct target_pt_regs *regs,

#ifdef TARGET_S390X

#define ELF_START_MMAP (0x20000000000ULL)

#define ELF_CLASS ELFCLASS64
#define ELF_DATA ELFDATA2MSB
#define ELF_ARCH EM_S390
Expand Down Expand Up @@ -1817,7 +1787,6 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs,

#ifdef TARGET_RISCV

#define ELF_START_MMAP 0x80000000
#define ELF_ARCH EM_RISCV

#ifdef TARGET_RISCV32
Expand Down Expand Up @@ -1853,7 +1822,6 @@ static inline void init_thread(struct target_pt_regs *regs,

#ifdef TARGET_HPPA

#define ELF_START_MMAP 0x80000000
#define ELF_CLASS ELFCLASS32
#define ELF_ARCH EM_PARISC
#define ELF_PLATFORM "PARISC"
Expand Down Expand Up @@ -1905,8 +1873,6 @@ static bool init_guest_commpage(void)

#ifdef TARGET_XTENSA

#define ELF_START_MMAP 0x20000000

#define ELF_CLASS ELFCLASS32
#define ELF_ARCH EM_XTENSA

Expand Down Expand Up @@ -1972,8 +1938,6 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs,

#ifdef TARGET_HEXAGON

#define ELF_START_MMAP 0x20000000

#define ELF_CLASS ELFCLASS32
#define ELF_ARCH EM_HEXAGON

Expand Down Expand Up @@ -3690,8 +3654,6 @@ int load_elf_binary(struct linux_binprm *bprm, struct image_info *info)
interp_info.fp_abi = MIPS_ABI_FP_UNKNOWN;
#endif

info->start_mmap = (abi_ulong)ELF_START_MMAP;

load_elf_image(bprm->filename, bprm->fd, info,
&elf_interpreter, bprm->buf);

Expand Down
1 change: 0 additions & 1 deletion linux-user/qemu.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ struct image_info {
abi_ulong start_data;
abi_ulong end_data;
abi_ulong brk;
abi_ulong start_mmap;
abi_ulong start_stack;
abi_ulong stack_limit;
abi_ulong entry;
Expand Down

0 comments on commit f6d4554

Please sign in to comment.