about summary refs log tree commit diff
path: root/elf/dl-load.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2010-03-15 11:44:58 -0700
committerUlrich Drepper <drepper@redhat.com>2010-03-15 11:44:58 -0700
commit92ad15a8f1d3e65f20fda3265c04ff26a642a2d0 (patch)
tree93c8c2a25e18b5d8fe583b0a1f0679278ce481ca /elf/dl-load.c
parent94db8db8e80d8b7fe094dee92660c158bf62d732 (diff)
downloadglibc-92ad15a8f1d3e65f20fda3265c04ff26a642a2d0.tar.gz
glibc-92ad15a8f1d3e65f20fda3265c04ff26a642a2d0.tar.xz
glibc-92ad15a8f1d3e65f20fda3265c04ff26a642a2d0.zip
Implement handling of libc ABI in ELF header.
Diffstat (limited to 'elf/dl-load.c')
-rw-r--r--elf/dl-load.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c
index e8c7be55f7..1cfab353d0 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1569,7 +1569,7 @@ open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
 #ifndef VALID_ELF_HEADER
 # define VALID_ELF_HEADER(hdr,exp,size)	(memcmp (hdr, exp, size) == 0)
 # define VALID_ELF_OSABI(osabi)		(osabi == ELFOSABI_SYSV)
-# define VALID_ELF_ABIVERSION(ver)	(ver == 0)
+# define VALID_ELF_ABIVERSION(ver)	(ver < LIBC_ABI_MAX)
 #elif defined MORE_ELF_HEADER_DATA
   MORE_ELF_HEADER_DATA;
 #endif
@@ -1655,7 +1655,9 @@ open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
 
       /* See whether the ELF header is what we expect.  */
       if (__builtin_expect (! VALID_ELF_HEADER (ehdr->e_ident, expected,
-						EI_PAD), 0))
+						EI_ABIVERSION)
+			    || !VALID_ELF_ABIVERSION (ehdr->e_ident[EI_ABIVERSION]),
+			    0))
 	{
 	  /* Something is wrong.  */
 	  const Elf32_Word *magp = (const void *) ehdr->e_ident;