From: Peter Crosthwaite <crosthwaitepeter@gmail.com>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com,
Peter Crosthwaite <crosthwaitepeter@gmail.com>,
riku.voipio@iki.fi,
Peter Crosthwaite <crosthwaite.peter@gmail.com>,
Peter Maydell <peter.maydell@linaro.org>
Subject: [Qemu-devel] [PATCH 03/19] arm: Remove ELF_MACHINE from cpu.h
Date: Sat, 15 Aug 2015 16:28:13 -0700 [thread overview]
Message-ID: <c1d65ef8279260da85edfe62e245b2c59c9f3959.1439679104.git.crosthwaite.peter@gmail.com> (raw)
In-Reply-To: <cover.1439679104.git.crosthwaite.peter@gmail.com>
In-Reply-To: <cover.1439679104.git.crosthwaite.peter@gmail.com>
From: Peter Crosthwaite <crosthwaitepeter@gmail.com>
The only generic code relying on this is linux-user. Linux user
already has a lot of #ifdef TARGET_ customisation so instead, define
ELF_ARCH as either EM_ARM or EM_AARCH64 appropriately.
The armv7m bootloader can just pass EM_ARM directly, as that
is architecture specific code. Note that arm_boot already has its own
logic selecting an arm specific elf machine so this makes V7M more
consistent with arm_boot.
This removes another architecture specific definition from the global
namespace.
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
hw/arm/armv7m.c | 2 +-
linux-user/elfload.c | 4 ++--
target-arm/cpu.h | 2 --
3 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c
index c6eab6d..ad89073 100644
--- a/hw/arm/armv7m.c
+++ b/hw/arm/armv7m.c
@@ -215,7 +215,7 @@ qemu_irq *armv7m_init(MemoryRegion *system_memory, int mem_size, int num_irq,
if (kernel_filename) {
image_size = load_elf(kernel_filename, NULL, NULL, &entry, &lowaddr,
- NULL, big_endian, ELF_MACHINE, 1);
+ NULL, big_endian, EM_ARM, 1);
if (image_size < 0) {
image_size = load_image_targphys(kernel_filename, 0, mem_size);
lowaddr = 0;
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index f84e760..09e1e6a 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -272,7 +272,7 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUX86State *en
#define ELF_START_MMAP 0x80000000
-#define ELF_ARCH ELF_MACHINE
+#define ELF_ARCH EM_ARM
#define ELF_CLASS ELFCLASS32
static inline void init_thread(struct target_pt_regs *regs,
@@ -478,7 +478,7 @@ static uint32_t get_elf_hwcap2(void)
/* 64 bit ARM definitions */
#define ELF_START_MMAP 0x80000000
-#define ELF_ARCH ELF_MACHINE
+#define ELF_ARCH EM_AARCH64
#define ELF_CLASS ELFCLASS64
#define ELF_PLATFORM "aarch64"
diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index 2e680da..a8ac799 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -26,10 +26,8 @@
#if defined(TARGET_AARCH64)
/* AArch64 definitions */
# define TARGET_LONG_BITS 64
-# define ELF_MACHINE EM_AARCH64
#else
# define TARGET_LONG_BITS 32
-# define ELF_MACHINE EM_ARM
#endif
#define TARGET_IS_BIENDIAN 1
--
1.9.1
next prev parent reply other threads:[~2015-08-15 23:28 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-15 23:28 [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE Peter Crosthwaite
2015-08-15 23:28 ` [Qemu-devel] [PATCH 01/19] linux_user: elfload: Default ELF_MACHINE to ELF_ARCH Peter Crosthwaite
2015-08-15 23:28 ` [Qemu-devel] [PATCH 02/19] linux-user: elfload: Provide default for elf_check_arch Peter Crosthwaite
2015-08-15 23:28 ` Peter Crosthwaite [this message]
2015-08-15 23:28 ` [Qemu-devel] [PATCH 04/19] mb: Remove ELF_MACHINE from cpu.h Peter Crosthwaite
2015-08-15 23:28 ` [Qemu-devel] [PATCH 05/19] m68k: " Peter Crosthwaite
2015-08-17 0:15 ` Greg Ungerer
2015-08-18 22:47 ` Laurent Vivier
2015-08-15 23:28 ` [Qemu-devel] [PATCH 06/19] cris: " Peter Crosthwaite
2015-08-15 23:28 ` [Qemu-devel] [PATCH 07/19] moxie: " Peter Crosthwaite
2015-08-17 18:39 ` Richard Henderson
2015-08-18 3:36 ` Peter Crosthwaite
2015-08-18 3:48 ` Richard Henderson
2015-08-23 6:49 ` Peter Crosthwaite
2015-08-23 15:43 ` Peter Maydell
2015-08-29 19:41 ` Peter Crosthwaite
2015-08-15 23:28 ` [Qemu-devel] [PATCH 08/19] unicore: " Peter Crosthwaite
2015-08-15 23:28 ` [Qemu-devel] [PATCH 10/19] or32: " Peter Crosthwaite
2015-08-15 23:28 ` [Qemu-devel] [PATCH 11/19] tricore: " Peter Crosthwaite
2015-08-18 18:01 ` Bastian Koppelmann
2015-08-15 23:28 ` [Qemu-devel] [PATCH 12/19] xtensa: " Peter Crosthwaite
2015-08-15 23:28 ` [Qemu-devel] [PATCH 13/19] sh4: " Peter Crosthwaite
2015-08-17 20:40 ` Aurelien Jarno
2015-08-15 23:28 ` [Qemu-devel] [PATCH 14/19] s390: " Peter Crosthwaite
2015-08-15 23:28 ` [Qemu-devel] [PATCH 15/19] sparc: " Peter Crosthwaite
2015-08-15 23:28 ` [Qemu-devel] [PATCH 16/19] mips: " Peter Crosthwaite
2015-08-17 20:40 ` Aurelien Jarno
2015-08-15 23:28 ` [Qemu-devel] [PATCH 17/19] alpha: " Peter Crosthwaite
2015-08-15 23:28 ` [Qemu-devel] [PATCH 18/19] i386: Rename ELF_MACHINE to be x86 specific Peter Crosthwaite
2015-08-17 19:13 ` Eduardo Habkost
2015-08-15 23:28 ` [Qemu-devel] [PATCH 19/19] ppc: Rename ELF_MACHINE to be PPC specific Peter Crosthwaite
2015-08-19 1:04 ` [Qemu-devel] [Qemu-ppc] " Laurent Vivier
2015-09-07 5:04 ` Peter Crosthwaite
2015-09-07 9:32 ` Alexander Graf
[not found] ` <9f0ea9969cdc869442178780fa35d6ac700bcd79.1439679104.git.crosthwaite.peter@gmail.com>
2015-08-16 22:47 ` [Qemu-devel] [PATCH 09/19] lm32: Remove ELF_MACHINE from cpu.h Michael Walle
2015-08-17 18:44 ` [Qemu-devel] [PATCH 00/19] multi-arch+linux-user: Cleanup ELF_MACHINE Richard Henderson
2015-08-20 7:50 ` Riku Voipio
2015-08-22 7:03 ` Paolo Bonzini
2015-09-07 9:54 ` Paolo Bonzini
2015-09-07 17:22 ` Peter Crosthwaite
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c1d65ef8279260da85edfe62e245b2c59c9f3959.1439679104.git.crosthwaite.peter@gmail.com \
--to=crosthwaitepeter@gmail.com \
--cc=crosthwaite.peter@gmail.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).