declare nios machine numbers

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

declare nios machine numbers

Mike Frysinger
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  <[hidden email]>:

        * 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  <[hidden email]>:

        * 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;
Reply | Threaded
Open this post in threaded view
|

Re: declare nios machine numbers

Nick Clifton
Hi Mike,

> 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

These patches are approved - please apply them, along with suitable
ChangeLog entries (which really should have been included with the patch
submission).

Cheers
   Nick



Reply | Threaded
Open this post in threaded view
|

Re: declare nios machine numbers

Mike Frysinger
On Monday 09 January 2006 07:49, Nick Clifton wrote:
> > 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
>
> These patches are approved - please apply them

i dont have access to apply them :)

> along with suitable ChangeLog entries (which really should have been
> included with the patch submission).

erm, the ChangeLog entry was at the top of each patch ...
-mike

Reply | Threaded
Open this post in threaded view
|

Re: declare nios machine numbers

Nick Clifton
Hi Mike,

>>These patches are approved - please apply them

> i dont have access to apply them :)

OK - I have applied them for you.

>>along with suitable ChangeLog entries (which really should have been
>>included with the patch submission).


> erm, the ChangeLog entry was at the top of each patch ...

Doh!

OK, so I am blind.  Sorry about that.

I did tweak your ChangeLog entry for the patch to common.h to 1) move it
into the include/elf directory, since there is a ChangeLog there and 2)
change it into the

   * <filename> ( <object> ) <description>

format which is more common for ChangeLog entries.

Cheers
   Nick

Reply | Threaded
Open this post in threaded view
|

Re: declare nios machine numbers

Mike Frysinger
On Monday 09 January 2006 12:28, Nick Clifton wrote:
> Hi Mike,
>
> >>These patches are approved - please apply them
> >
> > i dont have access to apply them :)
>
> OK - I have applied them for you.

thanks

> >>along with suitable ChangeLog entries (which really should have been
> >>included with the patch submission).
> >
> > erm, the ChangeLog entry was at the top of each patch ...
>
> I did tweak your ChangeLog entry for the patch to common.h to 1) move it
> into the include/elf directory, since there is a ChangeLog there and 2)
> change it into the
>
>    * <filename> ( <object> ) <description>
>
> format which is more common for ChangeLog entries.

i thought object applied to just enclosing scope (like function names) ...
thanks, i'll keep that in mind in the future
-mike