diff mbox

[18/19] i386: Rename ELF_MACHINE to be x86 specific

Message ID 54d29b8eefebfbf757830df47f3f520d08277ae9.1439679104.git.crosthwaite.peter@gmail.com
State New
Headers show

Commit Message

Peter Crosthwaite Aug. 15, 2015, 11:28 p.m. UTC
From: Peter Crosthwaite <crosthwaitepeter@gmail.com>

Rename ELF_MACHINE to be I386 specific. This is used as-is by the
multiboot loader.

Linux-user previously used this definition but will not anymore,
falling back to the default bahaviour of using ELF_ARCH as ELF_MACHINE.

This removes another architecture specific definition from the global
namespace.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
 hw/i386/multiboot.c | 2 +-
 target-i386/cpu.h   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Eduardo Habkost Aug. 17, 2015, 7:13 p.m. UTC | #1
On Sat, Aug 15, 2015 at 04:28:28PM -0700, Peter Crosthwaite wrote:
> From: Peter Crosthwaite <crosthwaitepeter@gmail.com>
> 
> Rename ELF_MACHINE to be I386 specific. This is used as-is by the
> multiboot loader.
> 
> Linux-user previously used this definition but will not anymore,
> falling back to the default bahaviour of using ELF_ARCH as ELF_MACHINE.
> 
> This removes another architecture specific definition from the global
> namespace.
> 
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Eduardo Habkost <ehabkost@redhat.com>
> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>

Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>

If somebody is going to pull the whole series through another tree:

Acked-by: Eduardo Habkost <ehabkost@redhat.com>

(It looks like I can't apply this to the x86 tree without patches 1/19
and 2/19)
diff mbox

Patch

diff --git a/hw/i386/multiboot.c b/hw/i386/multiboot.c
index 1adbe9e..6774a19 100644
--- a/hw/i386/multiboot.c
+++ b/hw/i386/multiboot.c
@@ -195,7 +195,7 @@  int load_multiboot(FWCfgState *fw_cfg,
         }
 
         kernel_size = load_elf(kernel_filename, NULL, NULL, &elf_entry,
-                               &elf_low, &elf_high, 0, ELF_MACHINE, 0);
+                               &elf_low, &elf_high, 0, I386_ELF_MACHINE, 0);
         if (kernel_size < 0) {
             fprintf(stderr, "Error while loading elf kernel\n");
             exit(1);
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 74b674d..bec5e72 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -36,10 +36,10 @@ 
 #define TARGET_HAS_PRECISE_SMC
 
 #ifdef TARGET_X86_64
-#define ELF_MACHINE     EM_X86_64
+#define I386_ELF_MACHINE  EM_X86_64
 #define ELF_MACHINE_UNAME "x86_64"
 #else
-#define ELF_MACHINE     EM_386
+#define I386_ELF_MACHINE  EM_386
 #define ELF_MACHINE_UNAME "i686"
 #endif