linux-user: Standardize on ELF_MACHINE not ELF_ARCH
PowerPC was the one outlier that defined both ELF_ARCH and ELF_MACHINE; ELF_ARCH was defined incorrectly, necessitating the definition of elf_check_arch. However, the elf file header field in question is called e_machine, so ELF_MACHINE is in fact the better name. Mechanically change most target/target_elf.h files, then adjust ppc/target_elf.h manually. Do not provide a default for ELF_MACHINE. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
14095cb5f8
commit
e6b7635c9a
20 changed files with 20 additions and 26 deletions
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include "target_ptrace.h"
|
||||
|
||||
#define ELF_ARCH EM_AARCH64
|
||||
#define ELF_MACHINE EM_AARCH64
|
||||
#define ELF_CLASS ELFCLASS64
|
||||
|
||||
#define HAVE_ELF_HWCAP 1
|
||||
|
|
|
|||
|
|
@ -9,6 +9,6 @@
|
|||
#define ALPHA_TARGET_ELF_H
|
||||
|
||||
#define ELF_CLASS ELFCLASS64
|
||||
#define ELF_ARCH EM_ALPHA
|
||||
#define ELF_MACHINE EM_ALPHA
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include "target_ptrace.h"
|
||||
|
||||
#define ELF_ARCH EM_ARM
|
||||
#define ELF_MACHINE EM_ARM
|
||||
#define ELF_CLASS ELFCLASS32
|
||||
#define EXSTACK_DEFAULT true
|
||||
|
||||
|
|
|
|||
|
|
@ -130,12 +130,8 @@ typedef abi_uint target_gid_t;
|
|||
#endif
|
||||
typedef abi_int target_pid_t;
|
||||
|
||||
#ifndef ELF_MACHINE
|
||||
#define ELF_MACHINE ELF_ARCH
|
||||
#endif
|
||||
|
||||
#ifndef elf_check_arch
|
||||
#define elf_check_arch(x) ((x) == ELF_ARCH)
|
||||
#define elf_check_arch(x) ((x) == ELF_MACHINE)
|
||||
#endif
|
||||
|
||||
#ifndef elf_check_abi
|
||||
|
|
|
|||
|
|
@ -19,6 +19,6 @@
|
|||
#define HEXAGON_TARGET_ELF_H
|
||||
|
||||
#define ELF_CLASS ELFCLASS32
|
||||
#define ELF_ARCH EM_HEXAGON
|
||||
#define ELF_MACHINE EM_HEXAGON
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#define HPPA_TARGET_ELF_H
|
||||
|
||||
#define ELF_CLASS ELFCLASS32
|
||||
#define ELF_ARCH EM_PARISC
|
||||
#define ELF_MACHINE EM_PARISC
|
||||
|
||||
#define HAVE_ELF_PLATFORM 1
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include "target_ptrace.h"
|
||||
|
||||
#define ELF_CLASS ELFCLASS32
|
||||
#define ELF_ARCH EM_386
|
||||
#define ELF_MACHINE EM_386
|
||||
#define EXSTACK_DEFAULT true
|
||||
#define VDSO_HEADER "vdso.c.inc"
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include "target_ptrace.h"
|
||||
|
||||
#define ELF_CLASS ELFCLASS64
|
||||
#define ELF_ARCH EM_LOONGARCH
|
||||
#define ELF_MACHINE EM_LOONGARCH
|
||||
#define EXSTACK_DEFAULT true
|
||||
#define elf_check_arch(x) ((x) == EM_LOONGARCH)
|
||||
#define VDSO_HEADER "vdso.c.inc"
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#define M68K_TARGET_ELF_H
|
||||
|
||||
#define ELF_CLASS ELFCLASS32
|
||||
#define ELF_ARCH EM_68K
|
||||
#define ELF_MACHINE EM_68K
|
||||
|
||||
#define HAVE_ELF_CORE_DUMP 1
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include "target_ptrace.h"
|
||||
|
||||
#define ELF_CLASS ELFCLASS32
|
||||
#define ELF_ARCH EM_MICROBLAZE
|
||||
#define ELF_MACHINE EM_MICROBLAZE
|
||||
|
||||
#define elf_check_arch(x) ((x) == EM_MICROBLAZE || (x) == EM_MICROBLAZE_OLD)
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include "target_ptrace.h"
|
||||
|
||||
#define ELF_CLASS ELFCLASS32
|
||||
#define ELF_ARCH EM_MIPS
|
||||
#define ELF_MACHINE EM_MIPS
|
||||
#define EXSTACK_DEFAULT true
|
||||
|
||||
#define HAVE_ELF_HWCAP 1
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include "target_ptrace.h"
|
||||
|
||||
#define ELF_CLASS ELFCLASS64
|
||||
#define ELF_ARCH EM_MIPS
|
||||
#define ELF_MACHINE EM_MIPS
|
||||
#define EXSTACK_DEFAULT true
|
||||
|
||||
#ifdef TARGET_ABI_MIPSN32
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include "target_ptrace.h"
|
||||
|
||||
#define ELF_ARCH EM_OPENRISC
|
||||
#define ELF_MACHINE EM_OPENRISC
|
||||
#define ELF_CLASS ELFCLASS32
|
||||
|
||||
#define HAVE_ELF_CORE_DUMP 1
|
||||
|
|
|
|||
|
|
@ -13,13 +13,11 @@
|
|||
#define ELF_MACHINE PPC_ELF_MACHINE
|
||||
|
||||
#ifdef TARGET_PPC64
|
||||
# define elf_check_arch(x) ((x) == EM_PPC64)
|
||||
# define ELF_CLASS ELFCLASS64
|
||||
#else
|
||||
# define ELF_CLASS ELFCLASS32
|
||||
# define EXSTACK_DEFAULT true
|
||||
#endif
|
||||
#define ELF_ARCH EM_PPC
|
||||
|
||||
#define HAVE_ELF_HWCAP 1
|
||||
#define HAVE_ELF_HWCAP2 1
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#ifndef RISCV_TARGET_ELF_H
|
||||
#define RISCV_TARGET_ELF_H
|
||||
|
||||
#define ELF_ARCH EM_RISCV
|
||||
#define ELF_MACHINE EM_RISCV
|
||||
|
||||
#ifdef TARGET_RISCV32
|
||||
#define ELF_CLASS ELFCLASS32
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include "target_ptrace.h"
|
||||
|
||||
#define ELF_CLASS ELFCLASS64
|
||||
#define ELF_ARCH EM_S390
|
||||
#define ELF_MACHINE EM_S390
|
||||
#define VDSO_HEADER "vdso.c.inc"
|
||||
|
||||
#define HAVE_ELF_HWCAP 1
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include "target_ptrace.h"
|
||||
|
||||
#define ELF_CLASS ELFCLASS32
|
||||
#define ELF_ARCH EM_SH
|
||||
#define ELF_MACHINE EM_SH
|
||||
|
||||
#define HAVE_ELF_HWCAP 1
|
||||
#define HAVE_ELF_CORE_DUMP 1
|
||||
|
|
|
|||
|
|
@ -10,13 +10,13 @@
|
|||
|
||||
#ifndef TARGET_SPARC64
|
||||
# define ELF_CLASS ELFCLASS32
|
||||
# define ELF_ARCH EM_SPARC
|
||||
# define ELF_MACHINE EM_SPARC
|
||||
#elif defined(TARGET_ABI32)
|
||||
# define ELF_CLASS ELFCLASS32
|
||||
# define elf_check_arch(x) ((x) == EM_SPARC32PLUS || (x) == EM_SPARC)
|
||||
#else
|
||||
# define ELF_CLASS ELFCLASS64
|
||||
# define ELF_ARCH EM_SPARCV9
|
||||
# define ELF_MACHINE EM_SPARCV9
|
||||
#endif
|
||||
|
||||
#define HAVE_ELF_HWCAP 1
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include "target_ptrace.h"
|
||||
|
||||
#define ELF_CLASS ELFCLASS64
|
||||
#define ELF_ARCH EM_X86_64
|
||||
#define ELF_MACHINE EM_X86_64
|
||||
#define VDSO_HEADER "vdso.c.inc"
|
||||
|
||||
#define HAVE_ELF_HWCAP 1
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include "target_ptrace.h"
|
||||
|
||||
#define ELF_CLASS ELFCLASS32
|
||||
#define ELF_ARCH EM_XTENSA
|
||||
#define ELF_MACHINE EM_XTENSA
|
||||
|
||||
#define HAVE_ELF_CORE_DUMP 1
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue