(ElfW, ELFW): Use it.
* elf/Makefile (headers): Add elfclass.h.
* sysdeps/wordsize-32/elfclass.h: New file.
* sysdeps/wordsize-64/elfclass.h: New file.
* sysdeps/alpha/Implies: Add wordsize-64.
* sysdeps/i386/Implies: Add wordsize-32.
* sysdeps/m68k/Implies: Add wordsize-32.
* sysdeps/mips/Implies: Add wordsize-32.
* sysdeps/sparc/Implies: Add wordsize-32.
Mon Jun 10 06:14:03 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
+ * elf/link.h: Include elfclass.h to define __ELF_NATIVE_CLASS.
+ (ElfW, ELFW): Use it.
+ * elf/Makefile (headers): Add elfclass.h.
+ * sysdeps/wordsize-32/elfclass.h: New file.
+ * sysdeps/wordsize-64/elfclass.h: New file.
+ * sysdeps/alpha/Implies: Add wordsize-64.
+ * sysdeps/i386/Implies: Add wordsize-32.
+ * sysdeps/m68k/Implies: Add wordsize-32.
+ * sysdeps/mips/Implies: Add wordsize-32.
+ * sysdeps/sparc/Implies: Add wordsize-32.
+
* sysdeps/mach/hurd/dl-sysdep.c (__open): Define this instead of open.
(__close, __mmap): Likewise define with __ names now.
subdir := elf
-headers = elf.h link.h dlfcn.h
+headers = elf.h elfclass.h link.h dlfcn.h
routines = init-first $(dl-routines) dl-open dl-symbol dl-support
# The core dynamic linking functions are in libc for the static and
#include <elf.h>
-#define __ELF_WORDSIZE 32 /* XXX */
-
/* We use this macro to refer to ELF types independent of the native wordsize.
`ElfW(TYPE)' is used in place of `Elf32_TYPE' or `Elf64_TYPE'. */
-#define ElfW(type) _ElfW (Elf, __ELF_WORDSIZE, type)
-#define ELFW(type) _ElfW (ELF, __ELF_WORDSIZE, type)
+#define ElfW(type) _ElfW (Elf, __ELF_NATIVE_CLASS, type)
+#define ELFW(type) _ElfW (ELF, __ELF_NATIVE_CLASS, type)
#define _ElfW(e,w,t) _ElfW_1 (e, w, _##t)
#define _ElfW_1(e,w,t) e##w##t
-
+#include <elfclass.h> /* Defines __ELF_NATIVE_CLASS. */
/* Rendezvous structure used by the run-time dynamic linker to communicate
details of shared object loading to the debugger. If the executable's
+wordsize-64
# Alpha uses IEEE 754 floating point.
ieee754
+wordsize-32
# 68k uses IEEE 754 floating point.
ieee754
+wordsize-32
# MIPS uses IEEE 754 floating point.
ieee754
+wordsize-32
# SPARC uses IEEE 754 floating point.
ieee754
--- /dev/null
+/* This file specifies the native word size of the machine, which indicates
+ the ELF file class used for executables and shared objects on this
+ machine. */
+
+#define __ELF_NATIVE_CLASS 32
--- /dev/null
+/* This file specifies the native word size of the machine, which indicates
+ the ELF file class used for executables and shared objects on this
+ machine. */
+
+#define __ELF_NATIVE_CLASS 64