This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] readelf: Add magic number for Freescale S12Z
- From: John Darrington <john at darrington dot wattle dot id dot au>
- To: binutils at sourceware dot org
- Cc: John Darrington <john at darrington dot wattle dot id dot au>
- Date: Thu, 10 May 2018 13:29:58 +0200
- Subject: [PATCH] readelf: Add magic number for Freescale S12Z
- References: <1525951798-21866-1-git-send-email-john@darrington.wattle.id.au>
* include/elf/common.h (EM_S12Z): New macro
* binutils/readelf.c (get_machine_name): EM_S12Z - handle new case.
---
binutils/readelf.c | 1 +
include/elf/common.h | 3 +++
2 files changed, 4 insertions(+)
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 0c676f2b22..6a9c51d4bb 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -2495,6 +2495,7 @@ get_machine_name (unsigned e_machine)
case EM_CYGNUS_MEP: return "Toshiba MeP Media Engine";
case EM_ADAPTEVA_EPIPHANY: return "Adapteva EPIPHANY";
case EM_CYGNUS_FRV: return "Fujitsu FR-V";
+ case EM_S12Z: return "Freescale S12Z";
default:
snprintf (buff, sizeof (buff), _("<unknown>: 0x%x"), e_machine);
diff --git a/include/elf/common.h b/include/elf/common.h
index ae4a7b2b61..9e2e2c5aba 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -368,6 +368,9 @@
/* Unofficial value for Web Assembly binaries, as used by LLVM. */
#define EM_WEBASSEMBLY 0x4157
+/* Freescale S12Z. The Freescale toolchain generates elf files with this value. */
+#define EM_S12Z 0x4DEF
+
/* DLX magic number. Written in the absense of an ABI. */
#define EM_DLX 0x5aa5
--
2.11.0