From 92ad15a8f1d3e65f20fda3265c04ff26a642a2d0 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 15 Mar 2010 11:44:58 -0700 Subject: Implement handling of libc ABI in ELF header. --- elf/dl-load.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'elf') 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; -- cgit 1.4.1