This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
declare nios machine numbers
- From: Mike Frysinger <vapier at gentoo dot org>
- To: binutils at sources dot redhat dot com
- Date: Mon, 2 Jan 2006 23:47:49 -0500
- Subject: declare nios machine numbers
i was playing around with the altera toolchain when i noticed they're using a
low EM_ number for their NIOS2 rather than a random 'safe' one ... so here's
two patches to add nios so someone else doesnt increment and collide
-mike
2006-01-02 Mike Frysinger <vapier@gentoo.org>:
* elf/common.h: Define EM_ALTERA_NIOS2 and EM_NIOS32.
Index: include/elf/common.h
===================================================================
RCS file: /cvs/src/src/include/elf/common.h,v
retrieving revision 1.74
diff -u -p -r1.74 common.h
--- include/elf/common.h 16 Dec 2005 10:23:10 -0000 1.74
+++ include/elf/common.h 3 Jan 2006 04:41:33 -0000
@@ -183,6 +183,7 @@
#define EM_CR 103 /* National Semiconductor CompactRISC */
#define EM_MSP430 105 /* TI msp430 micro controller */
#define EM_BLACKFIN 106 /* ADI Blackfin */
+#define EM_ALTERA_NIOS2 113 /* Altera Nios II soft-core processor */
#define EM_CRX 114 /* National Semiconductor CRX */
/* If it is necessary to assign new unofficial EM_* values, please pick large
@@ -273,6 +274,9 @@
/* Old, unofficial value for Xtensa. */
#define EM_XTENSA_OLD 0xabc7
+/* NIOS magic number - no EABI available. */
+#define EM_NIOS32 0xFEBB
+
/* See the above comment before you add a new EM_* value here. */
/* Values for e_version. */
2006-01-02 Mike Frysinger <vapier@gentoo.org>:
* readelf.c (guess_is_rela): Add case for Nios/Nios II.
(get_machine_name): Likewise.
Index: binutils/readelf.c
===================================================================
RCS file: /cvs/src/src/binutils/readelf.c,v
retrieving revision 1.329
diff -u -p -r1.329 readelf.c
--- binutils/readelf.c 30 Dec 2005 08:27:16 -0000 1.329
+++ binutils/readelf.c 3 Jan 2006 04:41:34 -0000
@@ -611,6 +611,8 @@ guess_is_rela (unsigned long e_machine)
case EM_M32C:
case EM_MT:
case EM_BLACKFIN:
+ case EM_NIOS32:
+ case EM_ALTERA_NIOS2:
return TRUE;
case EM_MMA:
@@ -1689,6 +1691,8 @@ get_machine_name (unsigned e_machine)
case EM_M32C: return "Renesas M32c";
case EM_MT: return "Morpho Techologies MT processor";
case EM_BLACKFIN: return "Analog Devices Blackfin";
+ case EM_NIOS32: return "Altera Nios";
+ case EM_ALTERA_NIOS2: return "Altera Nios II";
default:
snprintf (buff, sizeof (buff), _("<unknown>: %x"), e_machine);
return buff;