This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[m32c] update EM_M32C*


This switches M32C to the correct EM_* number, while still supporting
the old number read-only.  Applied.

	* common.h (EM_M32C_NEW): Rename to EM_M32C.
	(EM_M32C): Rename to EM_M32C_OLD.

	* elf32-m32c.c (ELF_MACHINE_ALT1): Define as EM_M32C_OLD.

	* readelf.c (guess_is_rela): Add EM_M32C_OLD.
	(dump_relocations): Likewise.
	(process_section_headers): Likewise.
	(is_32bit_abs_reloc): Likewise.
	(is_16bit_abs_reloc): Likewise.

Index: include/elf/common.h
===================================================================
RCS file: /cvs/src/src/include/elf/common.h,v
retrieving revision 1.95
diff -p -U3 -r1.95 common.h
--- include/elf/common.h	12 Jun 2008 12:44:01 -0000	1.95
+++ include/elf/common.h	12 Jun 2008 19:48:03 -0000
@@ -205,7 +205,7 @@
 #define EM_M16C		117	/* Renesas M16C series microprocessors */
 #define EM_DSPIC30F	118	/* Microchip Technology dsPIC30F Digital Signal Controller */
 #define EM_CE		119	/* Freescale Communication Engine RISC core */
-#define EM_M32C_NEW	120	/* Renesas M32C series microprocessors */
+#define EM_M32C		120	/* Renesas M32C series microprocessors */
 
 #define EM_TSK3000	131	/* Altium TSK3000 core */
 #define EM_RS08		132	/* Freescale RS08 embedded processor */
@@ -323,7 +323,7 @@
 #define EM_CYGNUS_MN10200	0xdead
 
 /* Renesas M32C and M16C.  */
-#define EM_M32C			0xFEB0
+#define EM_M32C_OLD		0xFEB0
 
 /* Vitesse IQ2000.  */
 #define EM_IQ2000		0xFEBA
Index: bfd/elf32-m32c.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-m32c.c,v
retrieving revision 1.16
diff -p -U3 -r1.16 elf32-m32c.c
--- bfd/elf32-m32c.c	25 Jan 2008 21:06:11 -0000	1.16
+++ bfd/elf32-m32c.c	12 Jun 2008 19:48:04 -0000
@@ -1998,6 +1998,7 @@ _bfd_m32c_elf_eh_frame_address_size (bfd
 
 #define ELF_ARCH		bfd_arch_m32c
 #define ELF_MACHINE_CODE	EM_M32C
+#define ELF_MACHINE_ALT1	EM_M32C_OLD
 #define ELF_MAXPAGESIZE		0x1000
 
 #if 0
Index: binutils/readelf.c
===================================================================
RCS file: /cvs/src/src/binutils/readelf.c,v
retrieving revision 1.409
diff -p -U3 -r1.409 readelf.c
--- binutils/readelf.c	1 May 2008 14:34:51 -0000	1.409
+++ binutils/readelf.c	12 Jun 2008 19:48:04 -0000
@@ -717,6 +717,7 @@ guess_is_rela (unsigned int e_machine)
     case EM_IP2K:
     case EM_IP2K_OLD:
     case EM_IQ2000:
+    case EM_M32C_OLD:
     case EM_M32C:
     case EM_M32R:
     case EM_MCORE:
@@ -1280,6 +1281,7 @@ dump_relocations (FILE *file,
 	  rtype = elf_xtensa_reloc_type (type);
 	  break;
 
+	case EM_M32C_OLD:
 	case EM_M32C:
 	  rtype = elf_m32c_reloc_type (type);
 	  break;
@@ -1914,6 +1916,7 @@ get_machine_name (unsigned e_machine)
     case EM_IQ2000:       	return "Vitesse IQ2000";
     case EM_XTENSA_OLD:
     case EM_XTENSA:		return "Tensilica Xtensa Processor";
+    case EM_M32C_OLD:
     case EM_M32C:	        return "Renesas M32c";
     case EM_MT:                 return "Morpho Techologies MT processor";
     case EM_BLACKFIN:		return "Analog Devices Blackfin";
@@ -4300,6 +4303,7 @@ process_section_headers (FILE *file)
 	}
       break;
 
+    case EM_M32C_OLD:
     case EM_M32C:
       switch (elf_header.e_flags & EF_M32C_CPU_MASK)
 	{
@@ -8152,6 +8156,7 @@ is_32bit_abs_reloc (unsigned int reloc_t
       return reloc_type == 2; /* R_IP2K_32.  */
     case EM_IQ2000:
       return reloc_type == 2; /* R_IQ2000_32.  */
+    case EM_M32C_OLD:
     case EM_M32C:
       return reloc_type == 3; /* R_M32C_32.  */
     case EM_M32R:
@@ -8326,6 +8331,7 @@ is_16bit_abs_reloc (unsigned int reloc_t
     case EM_IP2K_OLD:
     case EM_IP2K:
       return reloc_type == 1; /* R_IP2K_16.  */
+    case EM_M32C_OLD:
     case EM_M32C:
       return reloc_type == 1; /* R_M32C_16 */
     case EM_MSP430_OLD:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]