This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


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

Fix EM_S390 value



Newer binutils use 22 as value for EM_S390.  I hope this is the
official value.

Programs compiled with the new binutils will fail since dl-machine
checks only for the old value.  The appended patch corrects the value
and glibc checks now for both values so that glibc will work with old
and new binutils.

Martin, is this really the official value?  Is the appended patch ok?

Andreas


2001-03-09  Andreas Jaeger  <aj@suse.de>

	* sysdeps/s390/dl-machine.h (elf_machine_matches_host): Handle
	both new and old EM_S390 values.
	(EM_S390_OLD): New constant.

	* elf/elf.h (EM_S390): Use new value.

============================================================
Index: sysdeps/s390/dl-machine.h
--- sysdeps/s390/dl-machine.h	2001/02/28 06:35:24	1.3
+++ sysdeps/s390/dl-machine.h	2001/03/09 15:07:32
@@ -28,12 +28,14 @@
 #include <string.h>
 #include <link.h>
 
+/* This is an older, now obsolete value.  */
+#define EM_S390_OLD	0xA390
 
 /* Return nonzero iff ELF header is compatible with the running host.  */
 static inline int
 elf_machine_matches_host (const Elf32_Ehdr *ehdr)
 {
-  return ehdr->e_machine == EM_S390;
+  return (ehdr->e_machine == EM_S390 || ehdr->e_machine == EM_S390_OLD);
 }
 
 
============================================================
Index: elf/elf.h
--- elf/elf.h	2001/03/04 08:46:14	1.88
+++ elf/elf.h	2001/03/09 15:07:34
@@ -177,6 +177,7 @@
 #define EM_960		19		/* Intel 80960 */
 #define EM_PPC		20		/* PowerPC */
 #define EM_PPC64	21		/* PowerPC 64-bit */
+#define EM_S390		22		/* IBM S390 */
 
 #define EM_V800		36		/* NEC V800 series */
 #define EM_FR20		37		/* Fujitsu FR20 */
@@ -223,7 +224,6 @@
    chances of collision with official or non-GNU unofficial values.  */
 
 #define EM_ALPHA	0x9026
-#define EM_S390         0xA390		/* IBM S390 */
 
 /* Legal values for e_version (version).  */
 

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj


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