From patchwork Sat Aug 15 23:28:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Crosthwaite X-Patchwork-Id: 507652 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1310E14012C for ; Sun, 16 Aug 2015 09:29:28 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=jIyaS/x0; dkim-atps=neutral Received: from localhost ([::1]:51008 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZQktC-0007d0-CG for incoming@patchwork.ozlabs.org; Sat, 15 Aug 2015 19:29:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56755) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZQksY-0006N7-LZ for qemu-devel@nongnu.org; Sat, 15 Aug 2015 19:28:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZQksX-0000XY-13 for qemu-devel@nongnu.org; Sat, 15 Aug 2015 19:28:46 -0400 Received: from mail-pa0-x231.google.com ([2607:f8b0:400e:c03::231]:35543) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZQksW-0000XU-RB for qemu-devel@nongnu.org; Sat, 15 Aug 2015 19:28:44 -0400 Received: by pacgr6 with SMTP id gr6so82249583pac.2 for ; Sat, 15 Aug 2015 16:28:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=DUIUTV2PGxwOYBE4dloyIQbNHArRkZSt9j/ziG7Kens=; b=jIyaS/x0UpJFn7h1NZGalnqrYXuiksUSbYF5VtYBDYxxt9pz+nGwD/JSu1KlKbyBar ZtwkNRdkgwPmDIZ5uBw3CKxoR/JM3QHv6+/r4RkqUQUe5jWKR4sKs9t1yvAS8072bFg+ LwajdAdiZYHuXdXhGbd12GT3QYmqMr/JclZArRSVccqlTg0m44IveqZzgn8nBEZo5lP5 u6H1wyd/SPRZ/BYcVAafCxuHisznf7vL/QRHrboOn/YXKGhYyF0ZRd072Q15w1yiEUaU qUKJFs86lSyW3Ni3jcEeHMreTnjdIaBu3SgTV+eP7/fJRXWGKuGG5IeaxObBgbWmvxw8 KrqQ== X-Received: by 10.66.218.42 with SMTP id pd10mr103532361pac.106.1439681324214; Sat, 15 Aug 2015 16:28:44 -0700 (PDT) Received: from pcrost-box.hsd1.ca.comcast.net (c-50-168-24-48.hsd1.ca.comcast.net. [50.168.24.48]) by smtp.gmail.com with ESMTPSA id q6sm9863304pdp.14.2015.08.15.16.28.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 15 Aug 2015 16:28:43 -0700 (PDT) From: Peter Crosthwaite X-Google-Original-From: Peter Crosthwaite To: qemu-devel@nongnu.org Date: Sat, 15 Aug 2015 16:28:13 -0700 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c03::231 Cc: pbonzini@redhat.com, Peter Crosthwaite , riku.voipio@iki.fi, Peter Crosthwaite , Peter Maydell Subject: [Qemu-devel] [PATCH 03/19] arm: Remove ELF_MACHINE from cpu.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Peter Crosthwaite 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 Signed-off-by: Peter Crosthwaite --- 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