From dc95d1588775854fd5f7e617bfcb6f362bf3a923 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Fri, 26 May 2000 10:23:45 +0000 Subject: Update. 2000-05-26 Andreas Jaeger * elf/ldconfig.h: Update parameter list for process_elf_file. * sysdeps/unix/sysv/linux/sparc/readelflib.c (process_elf_file): Add parameter file_length and pass it ot process_elf*file. * sysdeps/generic/readelflib.c (check_ptr): New. (process_elf_file): Use check_ptr to check all accesses to the mmapped file. Add parameter file_length. * elf/readlib.c (known_libs): Use to specify library names. * sunrpc/xdr_intXX_t.c (xdr_uint8_t): Fix conversion. Closes PR libc/1573, reported by Bradley White . --- elf/readlib.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'elf/readlib.c') diff --git a/elf/readlib.c b/elf/readlib.c index 580d802301..1914267b93 100644 --- a/elf/readlib.c +++ b/elf/readlib.c @@ -35,6 +35,7 @@ #include #include +#include #include "ldconfig.h" @@ -49,23 +50,26 @@ struct known_names static struct known_names interpreters [] = { - {"/lib/ld-linux.so.2", FLAG_ELF_LIBC6}, + {"/lib/" LD_LINUX_SO, FLAG_ELF_LIBC6}, {"/lib/ld-linux.so.1", FLAG_ELF_LIBC5} }; static struct known_names known_libs [] = { - {"libc.so.6", FLAG_ELF_LIBC6}, + /* Old names: */ {"libc.so.5", FLAG_ELF_LIBC5}, - {"libm.so.6", FLAG_ELF_LIBC6}, - {"libm.so.5", FLAG_ELF_LIBC5} + {"libm.so.5", FLAG_ELF_LIBC5}, + /* Current names: */ + {LIBC_SO, FLAG_ELF_LIBC6}, + {LIBM_SO, FLAG_ELF_LIBC6} }; /* Returns 0 if everything is ok, != 0 in case of error. */ int -process_file (const char *file_name, const char *lib, int *flag, char **soname, int is_link) +process_file (const char *file_name, const char *lib, int *flag, + char **soname, int is_link) { FILE *file; struct stat statbuf; @@ -156,7 +160,8 @@ process_file (const char *file_name, const char *lib, int *flag, char **soname, goto done; } - if (process_elf_file (file_name, lib, flag, soname, file_contents)) + if (process_elf_file (file_name, lib, flag, soname, file_contents, + statbuf.st_size)) ret = 1; done: -- cgit v1.2.1