[PATCH] EM_CR16 e_machine value corrected

M R Swami Reddy MR.Swami.Reddy@nsc.com
Wed Jun 18 10:22:00 GMT 2008


Hi,

Revised patch for corrected value of EM_CR16 and defined EM_CR16_OLD macro
to compatible with OLD tool chain.

OK to commit?

Thanks,
Swami
====================================================================
Index: common.h
===================================================================
RCS file: /cvs/src/src/include/elf/common.h,v
retrieving revision 1.96
diff -c -r1.96 common.h
*** common.h    12 Jun 2008 19:49:47 -0000      1.96
--- common.h    18 Jun 2008 09:52:48 -0000
***************
*** 235,240 ****
--- 235,241 ----
   #define EM_METAG      174     /* Imagination Technologies META processor 
archi                    tecture */
   #define EM_MCST_ELBRUS        175     /* MCST Elbrus general purpose hardware 
                     architecture */
   #define EM_ECOG16     176     /* Cyan Technology eCOG16 family */
+ #define EM_CR16               177     /* National Semiconductor CompactRISC 
   16-bit processor */

   /* If it is necessary to assign new unofficial EM_* values, please pick large
      random numbers (0x8523, 0xa7f2, etc.) to minimize the chances of collision
***************
*** 258,265 ****
   /* picoJava */
   #define EM_PJ_OLD                     99

! /* National Semiconductor CompactRISC - CR16 */
! #define EM_CR16                       115

   /* AVR magic number.  Written in the absense of an ABI.  */
   #define EM_AVR_OLD            0x1057
--- 259,266 ----
   /* picoJava */
   #define EM_PJ_OLD                     99

! /* Old, unofficial value for National Semiconductor CompactRISC - CR16 */
! #define EM_CR16_OLD           115

   /* AVR magic number.  Written in the absense of an ABI.  */
   #define EM_AVR_OLD            0x1057
----------------------------------------------------------------------
Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/include/elf/ChangeLog,v
retrieving revision 1.328
diff -c -r1.328 ChangeLog
*** ChangeLog   12 Jun 2008 19:49:47 -0000      1.328
--- ChangeLog   18 Jun 2008 09:52:48 -0000
***************
*** 1,3 ****
--- 1,8 ----
+ 2008-06-18  M R Swami Reddy <MR.Swami.Reddy@nsc.com>
+
+       * common.h (EM_CR16): Correct value.
+       (EM_CR16): Rename to EM_CR16_OLD.
+
   2008-06-12  DJ Delorie  <dj@redhat.com>

         * common.h (EM_M32C_NEW): Rename to EM_M32C.
=====
Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/bfd/ChangeLog,v
retrieving revision 1.4212
diff -c -r1.4212 ChangeLog
*** ChangeLog   19 May 2008 06:06:02 -0000      1.4212
--- ChangeLog   18 Jun 2008 09:40:08 -0000
***************
*** 1,3 ****
--- 1,7 ----
+ 2008-06-18  M R Swami Reddy <MR.Swami.Reddy@nsc.com>
+
+       * elf32-cr16.c (ELF_MACHINE_ALT1): Define to EM_CR16_OLD.
+
   2008-05-19  Alan Modra  <amodra@bigpond.net.au>
===
Index: elf32-cr16.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-cr16.c,v
retrieving revision 1.4
diff -c -r1.4 elf32-cr16.c
*** elf32-cr16.c        12 Oct 2007 16:11:02 -0000      1.4
--- elf32-cr16.c        18 Jun 2008 09:40:07 -0000
***************
*** 1568,1573 ****
--- 1568,1574 ----
   #define TARGET_LITTLE_NAME                "elf32-cr16"
   #define ELF_ARCH                          bfd_arch_cr16
   #define ELF_MACHINE_CODE                  EM_CR16
+ #define ELF_MACHINE_ALT1                  EM_CR16_OLD
   #define ELF_MAXPAGESIZE                   0x1
   #define elf_symbol_leading_char           '_'
===================================================================================



Nick Clifton wrote:
> Hi Swami,
> 
>> ChangeLog:
>> 2008-06-18  M R Swami Reddy <MR.Swami.Reddy@nsc.com>
>  >
>>        * common.h (EM_CR16): Correct value.
> 
> This is OK to apply, but I think that you should also update 
> elf32-cr16.c so that it defines the old (incorrect) value as an 
> ELF_MACHINE_ALT1 value for compatibility with toolchains that may be 
> using it.
> 
> Cheers
>   Nick
> 
> 
> 
> 
> 



More information about the Binutils mailing list