bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PA: fix ELF ABI


From: Matthew Wilcox
Subject: PA: fix ELF ABI
Date: Fri, 20 Apr 2001 14:36:33 -0600

2001-04-20  Jes Sorensen  <address@hidden>

        * elf/elf.h (ELFOSABI_LINUX): Define as 3.

        * sysdeps/hppa/dl-machine.h: Provide private macros for
        VALID_ELF_HEADER() and friends accepting both ELFOSABI_SYSV (0)
        and ELFOSABI_LINUX.

        * sysdeps/hppa/dl-machine.h (RTLD_START): _dl_init now returns a
        function pointer, hence load the jump address and gp from the
        function pointer before jumping.

diff -urNx CVS glibc-2.2.1/elf/elf.h glibc/elf/elf.h
--- glibc-2.2.1/elf/elf.h       Thu Nov 16 12:58:55 2000
+++ glibc/elf/elf.h     Wed Dec 13 10:56:11 2000
@@ -139,6 +139,7 @@
 #define EI_OSABI       7               /* OS ABI identification */
 #define ELFOSABI_SYSV          0       /* UNIX System V ABI */
 #define ELFOSABI_HPUX          1       /* HP-UX */
+#define ELFOSABI_LINUX         3       /* Linux */
 #define ELFOSABI_ARM           97      /* ARM */
 #define ELFOSABI_STANDALONE    255     /* Standalone (embedded) application */
 
diff -urNx CVS glibc-2.2.1/sysdeps/hppa/dl-machine.h 
glibc/sysdeps/hppa/dl-machine.h
--- glibc-2.2.1/sysdeps/hppa/dl-machine.h       Thu Nov 16 13:00:28 2000
+++ glibc/sysdeps/hppa/dl-machine.h     Thu Mar 22 21:49:15 2001
@@ -28,6 +28,13 @@
 #include <link.h>
 #include <assert.h>
 
+# define VALID_ELF_OSABI(osabi)                ((osabi == ELFOSABI_SYSV) || 
(osabi == ELFOSABI_LINUX))
+# define VALID_ELF_ABIVERSION(ver)     (ver == 0)
+# define VALID_ELF_HEADER(hdr,exp,size) \
+  memcmp (hdr,exp,size-2) == 0 \
+  && VALID_ELF_OSABI (hdr[EI_OSABI]) \
+  && VALID_ELF_ABIVERSION (hdr[EI_ABIVERSION])
+
 /* These must match the definition of the stub in bfd/elf32-hppa.c. */
 #define SIZEOF_PLT_STUB (4*4)
 #define GOT_FROM_PLT_STUB (4*4)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]