This is the mail archive of the binutils@sources.redhat.com 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]

Getting rid of a lot of redundant code to set ELF machine codes


The other day, I asked myself why the heck there was that long switch
statement in bfd/elf.c:prep_headers(), if all the information was
already available in machine-specific #define ELF_MACHINE_CODE.  I
couldn't find an answer.  I asked Nick, and he suspected it was just
historical junk, so I went ahead and got rid of it.

While I was at it, I noticed that some of the machines for which
EM_CYGNUS_* numbers were picked at random have now (or a long time
ago) gained official numbers, so I went ahead and introduced the new
numbers, but kept the old ones as aliases.  I removed EM_CYGNUS_ARC,
since it has not been used for ages.  I was tempted to remove EM_PJ
(now EM_PJ_OLD) too, since the official EM numbers are getting close
to the number that was originally assigned to it, but I ended up
leaving it in.

This was tested against the CVS version of a few weeks ago, with
--enable-targets=all, but I only got to post it now.  I couldn't
retest it again today because ld/eelf64lppc.o appears to be broken:

eelf64ppc.o: In function `gldelf64ppc_find_exp_assignment':
eelf64ppc.o(.text+0xa98): undefined reference to `bfd_elf64_record_link_assignment'
eelf64ppc.o: In function `gldelf64ppc_before_allocation':
eelf64ppc.o(.text+0xbc7): undefined reference to `bfd_elf64_size_dynamic_sections'
eelf64lppc.o: In function `gldelf64lppc_find_exp_assignment':
eelf64lppc.o(.text+0xa98): undefined reference to `bfd_elf64_record_link_assignment'
eelf64lppc.o: In function `gldelf64lppc_before_allocation':
eelf64lppc.o(.text+0xbc7): undefined reference to `bfd_elf64_size_dynamic_sections'
collect2: ld returned 1 exit status
make[3]: *** [ld-new] Error 1


The patch was pre-approved by Nick Clifton.  I'm checking it in.

Index: include/elf/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* common.h (EM_AVR_OLD): Renamed from...
	(EM_AVR): this, redefined as in the current ELF standard.
	(EM_PJ_OLD): Renamed from...
	(EM_PJ): this, redefined as in the current ELF standard.
	(EM_R30, EM_D10V, EM_D30V, EM_V850, EM_M32R, EM_MN10300,
	EM_MN10200, EM_OPENRISC, EM_ARC_A5, EM_XTENSA): Defined as in
	the current ELF standard.
	(EM_CYGNUS_ARC): Removed, unused for a long time.

Index: include/elf/common.h
===================================================================
RCS file: /cvs/cvsfiles/devo/include/elf/common.h,v
retrieving revision 1.97.4.1
diff -u -p -r1.97.4.1 common.h
--- include/elf/common.h 2001/05/16 05:51:43 1.97.4.1
+++ include/elf/common.h 2001/08/08 12:35:07
@@ -163,6 +163,18 @@ Foundation, Inc., 59 Temple Place - Suit
 #define EM_MMIX	       80	/* Donald Knuth's educational 64-bit processor */
 #define EM_HUANY       81	/* Harvard's machine-independent format */
 #define EM_PRISM       82	/* SiTera Prism */
+#define EM_AVR         83	/* Atmel AVR 8-bit microcontroller */
+#define EM_FR30        84	/* Fujitsu FR30 */
+#define EM_D10V        85	/* Mitsubishi D10V */
+#define EM_D30V        86	/* Mitsubishi D30V */
+#define EM_V850        87	/* NEC v850 */
+#define EM_M32R        88	/* Mitsubishi M32R */
+#define EM_MN10300     89	/* Matsushita MN10300 */
+#define EM_MN10200     90	/* Matsushita MN10200 */
+#define EM_PJ          91	/* picoJava */
+#define EM_OPENRISC    92	/* OpenRISC 32-bit embedded processor */
+#define EM_ARC_A5      93	/* ARC Cores Tangent-A5 */
+#define EM_XTENSA      94	/* Tensilica Xtensa Architecture */
 
 /* If it is necessary to assign new unofficial EM_* values, please pick large
    random numbers (0x8523, 0xa7f2, etc.) to minimize the chances of collision
@@ -176,7 +188,7 @@ Foundation, Inc., 59 Temple Place - Suit
    unofficial e_machine number should eventually ask registry@sco.com for
    an officially blessed number to be added to the list above.  */
 
-#define EM_PJ          99       /* picoJava */
+#define EM_PJ_OLD      99       /* picoJava */
 
 /* Cygnus PowerPC ELF backend.  Written in the absence of an ABI.  */
 #define EM_CYGNUS_POWERPC 0x9025
@@ -188,9 +200,6 @@ Foundation, Inc., 59 Temple Place - Suit
 /* Old version of PowerPC, this should be removed shortly. */
 #define EM_PPC_OLD	17
 
-/* Cygnus ARC ELF backend.  Written in the absence of an ABI.  */
-#define EM_CYGNUS_ARC 0x9040
-
 /* Cygnus M32R ELF backend.  Written in the absence of an ABI.  */
 #define EM_CYGNUS_M32R 0x9041
 
@@ -219,7 +228,7 @@ Foundation, Inc., 59 Temple Place - Suit
 
 /* AVR magic number
    Written in the absense of an ABI.  */
-#define EM_AVR			0x1057
+#define EM_AVR_OLD		0x1057
 
 /* See the above comment before you add a new EM_* value here.  */
 
Index: bfd/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* elf.c (prep_headers): Get the machine code from the elf
	backend data.
	* elf-m10200.c (ELF_MACHINE_CODE): Redefine to EM_MN10200.
	(ELF_MACHINE_ALT1): Define to EM_CYGNUS_MN10200.
	* elf-m10300.c (ELF_MACHINE_CODE): Redefine to EM_MN10300.
	(ELF_MACHINE_ALT1): Define to EM_CYGNUS_MN10300.
	* elf-arc.c (arc_elf_final_write_processing): Don't override
	e_machine, it's now properly set in prep_headers.
	* elf32-avr.c (elf32_avr_object_p): Accept both EM_AVR and
	EM_AVR_OLD.
	(ELF_MACHINE_ALT1): Define to EM_AVR_OLD.
	* elf-d10v.c (ELF_MACHINE_CODE): Redefine to EM_D10V.
	(ELF_MACHINE_ALT1): Define to EM_CYGNUS_D10V.
	* elf-d30v.c (ELF_MACHINE_CODE): Redefine to EM_D30V.
	(ELF_MACHINE_ALT1): Define to EM_CYGNUS_D30V.
	* elf-fr30.c (ELF_MACHINE_CODE): Redefine to EM_FR30.
	(ELF_MACHINE_ALT1): Define to EM_CYGNUS_FR30.
	* elf-m32r.c (ELF_MACHINE_CODE): Redefine to EM_M32R.
	(ELF_MACHINE_ALT1): Define to EM_CYGNUS_M32R.
	* elf32-pj.c (ELF_MACHINE_ALT1): DEfine to EM_PJ_OLD.
	* elf-v850.c (ELF_MACHINE_CODE): Redefine to EM_V850.
	(ELF_MACHINE_ALT1): Define to EM_CYGNUS_V850.

Index: bfd/elf.c
===================================================================
RCS file: /cvs/cvsfiles/devo/bfd/elf.c,v
retrieving revision 1.277.4.1
diff -u -p -r1.277.4.1 elf.c
--- bfd/elf.c 2001/05/16 05:47:19 1.277.4.1
+++ bfd/elf.c 2001/08/29 21:33:24
@@ -3316,107 +3316,22 @@ prep_headers (abfd)
     case bfd_arch_unknown:
       i_ehdrp->e_machine = EM_NONE;
       break;
-    case bfd_arch_sparc:
-      if (bfd_get_arch_size (abfd) == 64)
-	i_ehdrp->e_machine = EM_SPARCV9;
-      else
-	i_ehdrp->e_machine = EM_SPARC;
-      break;
-    case bfd_arch_i370:
-      i_ehdrp->e_machine = EM_S370;
-      break;
-    case bfd_arch_i386:
-      if (bfd_get_arch_size (abfd) == 64)
-	i_ehdrp->e_machine = EM_X86_64;
-      else
-	i_ehdrp->e_machine = EM_386;
-      break;
-    case bfd_arch_ia64:
-      i_ehdrp->e_machine = EM_IA_64;
-      break;
-    case bfd_arch_m68hc11:
-      i_ehdrp->e_machine = EM_68HC11;
-      break;
-    case bfd_arch_m68hc12:
-      i_ehdrp->e_machine = EM_68HC12;
-      break;
-    case bfd_arch_s390:
-      i_ehdrp->e_machine = EM_S390;
-      break;
-    case bfd_arch_m68k:
-      i_ehdrp->e_machine = EM_68K;
-      break;
-    case bfd_arch_m88k:
-      i_ehdrp->e_machine = EM_88K;
-      break;
-    case bfd_arch_i860:
-      i_ehdrp->e_machine = EM_860;
-      break;
-    case bfd_arch_i960:
-      i_ehdrp->e_machine = EM_960;
-      break;
-    case bfd_arch_mips:	/* MIPS Rxxxx */
-      i_ehdrp->e_machine = EM_MIPS;	/* only MIPS R3000 */
-      break;
-    case bfd_arch_hppa:
-      i_ehdrp->e_machine = EM_PARISC;
-      break;
-    case bfd_arch_powerpc:
-      i_ehdrp->e_machine = EM_PPC;
-      break;
-    case bfd_arch_alpha:
-      i_ehdrp->e_machine = EM_ALPHA;
-      break;
-    case bfd_arch_sh:
-      i_ehdrp->e_machine = EM_SH;
-      break;
-    case bfd_arch_d10v:
-      i_ehdrp->e_machine = EM_CYGNUS_D10V;
-      break;
-    case bfd_arch_d30v:
-      i_ehdrp->e_machine = EM_CYGNUS_D30V;
-      break;
-    case bfd_arch_fr30:
-      i_ehdrp->e_machine = EM_CYGNUS_FR30;
-      break;
-    case bfd_arch_mcore:
-      i_ehdrp->e_machine = EM_MCORE;
-      break;
-    case bfd_arch_avr:
-      i_ehdrp->e_machine = EM_AVR;
-      break;
-    case bfd_arch_v850:
-      switch (bfd_get_mach (abfd))
-	{
-	default:
-	case 0:               i_ehdrp->e_machine = EM_CYGNUS_V850; break;
-	}
-      break;
-    case bfd_arch_arc:
-      i_ehdrp->e_machine = EM_CYGNUS_ARC;
-      break;
-    case bfd_arch_arm:
-      i_ehdrp->e_machine = EM_ARM;
-      break;
-    case bfd_arch_m32r:
-      i_ehdrp->e_machine = EM_CYGNUS_M32R;
-      break;
-    case bfd_arch_mn10200:
-      i_ehdrp->e_machine = EM_CYGNUS_MN10200;
-      break;
-    case bfd_arch_mn10300:
-      i_ehdrp->e_machine = EM_CYGNUS_MN10300;
-      break;
-    case bfd_arch_pj:
-      i_ehdrp->e_machine = EM_PJ;
-      break;
-    case bfd_arch_cris:
-      i_ehdrp->e_machine = EM_CRIS;
-      break;
-      /* also note that EM_M32, AT&T WE32100 is unknown to bfd */
+
+      /* There used to be a long list of cases here, each one setting
+	 e_machine to the same EM_* macro #defined as ELF_MACHINE_CODE
+	 in the corresponding bfd definition.  To avoid duplication,
+	 the switch was removed.  Machines that need special handling
+	 can generally do it in elf_backend_final_write_processing(),
+	 unless they need the information earlier than the final write.
+	 Such need can generally be supplied by replacing the tests for
+	 e_machine with the conditions used to determine it.  */
     default:
-      i_ehdrp->e_machine = EM_NONE;
+      if (get_elf_backend_data (abfd) != NULL)
+	i_ehdrp->e_machine = get_elf_backend_data (abfd)->elf_machine_code;
+      else
+	i_ehdrp->e_machine = EM_NONE;
     }
+
   i_ehdrp->e_version = bed->s->ev_current;
   i_ehdrp->e_ehsize = bed->s->sizeof_ehdr;
 
Index: bfd/elf-m10200.c
===================================================================
RCS file: /cvs/cvsfiles/devo/bfd/elf-m10200.c,v
retrieving revision 1.11
diff -u -p -r1.11 elf-m10200.c
--- bfd/elf-m10200.c 2001/03/15 04:23:05 1.11
+++ bfd/elf-m10200.c 2001/08/08 12:35:00
@@ -1503,7 +1503,8 @@ mn10200_elf_get_relocated_section_conten
 #define TARGET_LITTLE_SYM	bfd_elf32_mn10200_vec
 #define TARGET_LITTLE_NAME	"elf32-mn10200"
 #define ELF_ARCH		bfd_arch_mn10200
-#define ELF_MACHINE_CODE	EM_CYGNUS_MN10200
+#define ELF_MACHINE_CODE	EM_MN10200
+#define ELF_MACHINE_ALT1	EM_CYGNUS_MN10200
 #define ELF_MAXPAGESIZE		0x1000
 
 #define elf_info_to_howto	mn10200_info_to_howto
Index: bfd/elf-m10300.c
===================================================================
RCS file: /cvs/cvsfiles/devo/bfd/elf-m10300.c,v
retrieving revision 1.36.2.3
diff -u -p -r1.36.2.3 elf-m10300.c
--- bfd/elf-m10300.c 2001/05/16 10:35:11 1.36.2.3
+++ bfd/elf-m10300.c 2001/08/08 12:35:01
@@ -4975,7 +5017,8 @@ _bfd_mn10300_elf_finish_dynamic_sections
 #define TARGET_LITTLE_SYM	bfd_elf32_mn10300_vec
 #define TARGET_LITTLE_NAME	"elf32-mn10300"
 #define ELF_ARCH		bfd_arch_mn10300
-#define ELF_MACHINE_CODE	EM_CYGNUS_MN10300
+#define ELF_MACHINE_CODE	EM_MN10300
+#define ELF_MACHINE_ALT1	EM_CYGNUS_MN10300
 #define ELF_MAXPAGESIZE		0x1000
 #endif
 
Index: bfd/elf32-arc.c
===================================================================
RCS file: /cvs/cvsfiles/devo/bfd/elf32-arc.c,v
retrieving revision 1.18
diff -u -p -r1.18 elf32-arc.c
--- bfd/elf32-arc.c 2001/03/15 04:23:05 1.18
+++ bfd/elf32-arc.c 2001/08/08 12:35:03
@@ -207,7 +207,6 @@ arc_elf_final_write_processing (abfd, li
       val = E_ARC_MACH_ARC8;
       break;
     }
-  elf_elfheader (abfd)->e_machine = EM_ARC;
   elf_elfheader (abfd)->e_flags &=~ EF_ARC_MACH;
   elf_elfheader (abfd)->e_flags |= val;
 }
Index: bfd/elf32-avr.c
===================================================================
RCS file: /cvs/cvsfiles/devo/bfd/elf32-avr.c,v
retrieving revision 1.7
diff -u -p -r1.7 elf32-avr.c
--- bfd/elf32-avr.c 2001/03/15 04:23:05 1.7
+++ bfd/elf32-avr.c 2001/08/08 12:35:03
@@ -914,7 +914,8 @@ elf32_avr_object_p (abfd)
      bfd *abfd;
 {
   int e_set = bfd_mach_avr2;
-  if (elf_elfheader (abfd)->e_machine == EM_AVR)
+  if (elf_elfheader (abfd)->e_machine == EM_AVR
+      || elf_elfheader (abfd)->e_machine == EM_AVR_OLD)
     {
       int e_mach = elf_elfheader (abfd)->e_flags & EF_AVR_MACH;
       switch (e_mach)
@@ -947,6 +948,7 @@ elf32_avr_object_p (abfd)
 
 #define ELF_ARCH		bfd_arch_avr
 #define ELF_MACHINE_CODE	EM_AVR
+#define ELF_MACHINE_ALT1	EM_AVR_OLD
 #define ELF_MAXPAGESIZE		1
 
 #define TARGET_LITTLE_SYM       bfd_elf32_avr_vec
Index: bfd/elf32-d10v.c
===================================================================
RCS file: /cvs/cvsfiles/devo/bfd/elf32-d10v.c,v
retrieving revision 1.12
diff -u -p -r1.12 elf32-d10v.c
--- bfd/elf32-d10v.c 2001/03/15 04:23:05 1.12
+++ bfd/elf32-d10v.c 2001/08/08 12:35:03
@@ -503,7 +503,8 @@ elf32_d10v_relocate_section (output_bfd,
   return true;
 }
 #define ELF_ARCH		bfd_arch_d10v
-#define ELF_MACHINE_CODE	EM_CYGNUS_D10V
+#define ELF_MACHINE_CODE	EM_D10V
+#define ELF_MACHINE_ALT1	EM_CYGNUS_D10V
 #define ELF_MAXPAGESIZE		0x1000
 
 #define TARGET_BIG_SYM          bfd_elf32_d10v_vec
Index: bfd/elf32-d30v.c
===================================================================
RCS file: /cvs/cvsfiles/devo/bfd/elf32-d30v.c,v
retrieving revision 1.13
diff -u -p -r1.13 elf32-d30v.c
--- bfd/elf32-d30v.c 2001/03/15 04:23:05 1.13
+++ bfd/elf32-d30v.c 2001/08/08 12:35:03
@@ -546,7 +546,8 @@ d30v_info_to_howto_rela (abfd, cache_ptr
 }
 
 #define ELF_ARCH		bfd_arch_d30v
-#define ELF_MACHINE_CODE	EM_CYGNUS_D30V
+#define ELF_MACHINE_CODE	EM_D30V
+#define ELF_MACHINE_ALT1	EM_CYGNUS_D30V
 #define ELF_MAXPAGESIZE		0x1000
 
 #define TARGET_BIG_SYM          bfd_elf32_d30v_vec
Index: bfd/elf32-fr30.c
===================================================================
RCS file: /cvs/cvsfiles/devo/bfd/elf32-fr30.c,v
retrieving revision 1.22
diff -u -p -r1.22 elf32-fr30.c
--- bfd/elf32-fr30.c 2001/03/15 04:23:05 1.22
+++ bfd/elf32-fr30.c 2001/08/08 12:35:04
@@ -792,7 +792,8 @@ fr30_elf_check_relocs (abfd, info, sec, 
 }
 
 #define ELF_ARCH		bfd_arch_fr30
-#define ELF_MACHINE_CODE	EM_CYGNUS_FR30
+#define ELF_MACHINE_CODE	EM_FR30
+#define ELF_MACHINE_ALT1	EM_CYGNUS_FR30
 #define ELF_MAXPAGESIZE		0x1000
 
 #define TARGET_BIG_SYM          bfd_elf32_fr30_vec
Index: bfd/elf32-m32r.c
===================================================================
RCS file: /cvs/cvsfiles/devo/bfd/elf32-m32r.c,v
retrieving revision 1.36
diff -u -p -r1.36 elf32-m32r.c
--- bfd/elf32-m32r.c 2001/03/15 04:23:07 1.36
+++ bfd/elf32-m32r.c 2001/08/08 12:35:04
@@ -2159,7 +2159,8 @@ m32r_elf_check_relocs (abfd, info, sec, 
 }
 
 #define ELF_ARCH		bfd_arch_m32r
-#define ELF_MACHINE_CODE	EM_CYGNUS_M32R
+#define ELF_MACHINE_CODE	EM_M32R
+#define ELF_MACHINE_ALT1	EM_CYGNUS_M32R
 #define ELF_MAXPAGESIZE		0x1 /* Explicitly requested by Mitsubishi.  */
 
 #define TARGET_BIG_SYM          bfd_elf32_m32r_vec
Index: bfd/elf32-pj.c
===================================================================
RCS file: /cvs/cvsfiles/devo/bfd/elf32-pj.c,v
retrieving revision 1.3
diff -u -p -r1.3 elf32-pj.c
--- bfd/elf32-pj.c 2001/03/15 04:23:07 1.3
+++ bfd/elf32-pj.c 2001/08/08 12:35:04
@@ -339,6 +339,7 @@ pj_elf_final_write_processing (abfd, lin
 #define TARGET_LITTLE_NAME	"elf32-pjl"
 #define ELF_ARCH		bfd_arch_pj
 #define ELF_MACHINE_CODE	EM_PJ
+#define ELF_MACHINE_ALT1	EM_PJ_OLD
 #define ELF_MAXPAGESIZE		0x1000
 #define bfd_elf32_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
 #define bfd_elf32_bfd_reloc_type_lookup	             pj_elf_reloc_type_lookup
Index: bfd/elf32-v850.c
===================================================================
RCS file: /cvs/cvsfiles/devo/bfd/elf32-v850.c,v
retrieving revision 1.73
diff -u -p -r1.73 elf32-v850.c
--- bfd/elf32-v850.c 2001/03/15 04:23:08 1.73
+++ bfd/elf32-v850.c 2001/08/08 12:35:05
@@ -2202,7 +2202,8 @@ v850_elf_fake_sections (abfd, hdr, sec)
 #define TARGET_LITTLE_SYM			bfd_elf32_v850_vec
 #define TARGET_LITTLE_NAME			"elf32-v850"
 #define ELF_ARCH				bfd_arch_v850
-#define ELF_MACHINE_CODE			EM_CYGNUS_V850
+#define ELF_MACHINE_CODE			EM_V850
+#define ELF_MACHINE_ALT1			EM_CYGNUS_V850
 #define ELF_MAXPAGESIZE				0x1000
 
 #define elf_info_to_howto			v850_elf_info_to_howto_rela
Index: binutils/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* readelf.c (guess_is_rela, dump_relocations, get_machine_name,
	get_machine_flags): Added EM_M32R, EM_D10V, EM_V850, EM_D30V,
	EM_MN10200, EM_MN10300, EM_FR30, EM_AVR_OLD and EM_PJ_OLD.
	Removed EM_CYGNUS_ARC.

Index: binutils/readelf.c
===================================================================
RCS file: /cvs/cvsfiles/devo/binutils/readelf.c,v
retrieving revision 1.141.4.3
diff -u -p -r1.141.4.3 readelf.c
--- binutils/readelf.c 2001/08/08 11:19:37 1.141.4.3
+++ binutils/readelf.c 2001/08/08 12:34:55
@@ -559,7 +559,9 @@ guess_is_rela (e_machine)
     case EM_386:
     case EM_486:
     case EM_960:
+    case EM_M32R:
     case EM_CYGNUS_M32R:
+    case EM_D10V:
     case EM_CYGNUS_D10V:
     case EM_MIPS:
     case EM_MIPS_RS4_BE:
@@ -571,16 +573,22 @@ guess_is_rela (e_machine)
     case EM_SPARCV9:
     case EM_SPARC:
     case EM_PPC:
+    case EM_V850:
     case EM_CYGNUS_V850:
+    case EM_D30V:
     case EM_CYGNUS_D30V:
+    case EM_MN10200:
     case EM_CYGNUS_MN10200:
+    case EM_MN10300:
     case EM_CYGNUS_MN10300:
+    case EM_FR30:
     case EM_CYGNUS_FR30:
     case EM_SH:
     case EM_ALPHA:
     case EM_MCORE:
     case EM_IA_64:
     case EM_AVR:
+    case EM_AVR_OLD:
     case EM_CRIS:
     case EM_860:
     case EM_X86_64:
@@ -837,6 +845,7 @@ dump_relocations (file, rel_offset, rel_
 	  rtype = NULL;
 	  break;
 
+	case EM_M32R:
 	case EM_CYGNUS_M32R:
 	  rtype = elf_m32r_reloc_type (type);
 	  break;
@@ -855,6 +864,7 @@ dump_relocations (file, rel_offset, rel_
 	  break;
 
 	case EM_AVR:
+	case EM_AVR_OLD:
 	  rtype = elf_avr_reloc_type (type);
 	  break;
 
@@ -865,14 +875,17 @@ dump_relocations (file, rel_offset, rel_
 	  rtype = elf_sparc_reloc_type (type);
 	  break;
 
+	case EM_V850:
 	case EM_CYGNUS_V850:
 	  rtype = v850_reloc_type (type);
 	  break;
 
+	case EM_D10V:
 	case EM_CYGNUS_D10V:
 	  rtype = elf_d10v_reloc_type (type);
 	  break;
 
+	case EM_D30V:
 	case EM_CYGNUS_D30V:
 	  rtype = elf_d30v_reloc_type (type);
 	  break;
@@ -881,14 +894,17 @@ dump_relocations (file, rel_offset, rel_
 	  rtype = elf_sh_reloc_type (type);
 	  break;
 
+	case EM_MN10300:
 	case EM_CYGNUS_MN10300:
 	  rtype = elf_mn10300_reloc_type (type);
 	  break;
 
+	case EM_MN10200:
 	case EM_CYGNUS_MN10200:
 	  rtype = elf_mn10200_reloc_type (type);
 	  break;
 
+	case EM_FR30:
 	case EM_CYGNUS_FR30:
 	  rtype = elf_fr30_reloc_type (type);
 	  break;
@@ -914,7 +930,6 @@ dump_relocations (file, rel_offset, rel_
 	  rtype = elf_arm_reloc_type (type);
 	  break;
 
-	case EM_CYGNUS_ARC:
 	case EM_ARC:
 	  rtype = elf_arc_reloc_type (type);
 	  break;
@@ -924,6 +939,7 @@ dump_relocations (file, rel_offset, rel_
 	  break;
 
 	case EM_PJ:
+	case EM_PJ_OLD:
 	  rtype = elf_pj_reloc_type (type);
 	  break;
 	case EM_IA_64:
@@ -1290,14 +1306,21 @@ get_machine_name (e_machine)
     case EM_COLDFIRE:		return "Motorola Coldfire";
     case EM_68HC12:		return "Motorola M68HC12";
     case EM_ALPHA:       	return "Alpha";
-    case EM_CYGNUS_D10V:        return "d10v";
-    case EM_CYGNUS_D30V:        return "d30v";
-    case EM_CYGNUS_ARC:		return "ARC";
-    case EM_CYGNUS_M32R:	return "Mitsubishi M32r";
-    case EM_CYGNUS_V850:	return "NEC v850";
-    case EM_CYGNUS_MN10300:	return "mn10300";
-    case EM_CYGNUS_MN10200:	return "mn10200";
-    case EM_CYGNUS_FR30:	return "Fujitsu FR30";
+    case EM_CYGNUS_D10V:
+    case EM_D10V:		return "d10v";
+    case EM_CYGNUS_D30V:
+    case EM_D30V:	        return "d30v";
+    case EM_CYGNUS_M32R:
+    case EM_M32R:		return "Mitsubishi M32r";
+    case EM_CYGNUS_V850:
+    case EM_V850:		return "NEC v850";
+    case EM_CYGNUS_MN10300:
+    case EM_MN10300:		return "mn10300";
+    case EM_CYGNUS_MN10200:
+    case EM_MN10200:		return "mn10200";
+    case EM_CYGNUS_FR30:
+    case EM_FR30:		return "Fujitsu FR30";
+    case EM_PJ_OLD:
     case EM_PJ:                 return "picoJava";
     case EM_MMA:      		return "Fujitsu Multimedia Accelerator";
     case EM_PCP:      		return "Siemens PCP";
@@ -1317,6 +1340,7 @@ get_machine_name (e_machine)
     case EM_SVX:      		return "Silicon Graphics SVx";
     case EM_ST19:     		return "STMicroelectronics ST19 8-bit microcontroller";
     case EM_VAX:      		return "Digital VAX";
+    case EM_AVR_OLD:
     case EM_AVR:                return "Atmel AVR 8-bit microcontroller";
     case EM_CRIS:		return "Axis Communications 32-bit embedded processor";
     case EM_JAVELIN:     	return "Infineon Technologies 32-bit embedded cpu";
@@ -1512,6 +1536,7 @@ get_machine_flags (e_flags, e_machine)
 	    strcat (buf, ", relocatable-lib");
 	  break;
 
+	case EM_V850:
 	case EM_CYGNUS_V850:
 	  switch (e_flags & EF_V850_ARCH)
 	    {
@@ -1530,6 +1555,7 @@ get_machine_flags (e_flags, e_machine)
 	    }
 	  break;
 
+	case EM_M32R:
 	case EM_CYGNUS_M32R:
 	  if ((e_flags & EF_M32R_ARCH) == E_M32R_ARCH)
 	    strcat (buf, ", m32r");
@@ -1646,6 +1672,7 @@ get_machine_flags (e_flags, e_machine)
 	  break;
 
 	case EM_PJ:
+	case EM_PJ_OLD:
 	  if ((e_flags & EF_PICOJAVA_NEWCALLS) == EF_PICOJAVA_NEWCALLS)
 	    strcat (buf, ", new calling convention");
 

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

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