aboutsummaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2000-05-26 10:23:45 +0000
committerAndreas Jaeger <aj@suse.de>2000-05-26 10:23:45 +0000
commitdc95d1588775854fd5f7e617bfcb6f362bf3a923 (patch)
treee504b5ae583c53fb4eacf9dd3ef21ef5b6b46724 /elf
parent446e763b48ca29dafd14cb4c65212ac81786b4f0 (diff)
downloadglibc-dc95d1588775854fd5f7e617bfcb6f362bf3a923.zip
glibc-dc95d1588775854fd5f7e617bfcb6f362bf3a923.tar.gz
glibc-dc95d1588775854fd5f7e617bfcb6f362bf3a923.tar.bz2
Update.
2000-05-26 Andreas Jaeger <aj@suse.de> * 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 <gnu/lib-names.h> to specify library names. * sunrpc/xdr_intXX_t.c (xdr_uint8_t): Fix conversion. Closes PR libc/1573, reported by Bradley White <bww@laurelnetworks.com>.
Diffstat (limited to 'elf')
-rw-r--r--elf/ldconfig.h3
-rw-r--r--elf/readlib.c17
2 files changed, 13 insertions, 7 deletions
diff --git a/elf/ldconfig.h b/elf/ldconfig.h
index ecdbb14..a94df64 100644
--- a/elf/ldconfig.h
+++ b/elf/ldconfig.h
@@ -46,7 +46,8 @@ extern int process_file (const char *file_name, const char *lib, int *flag,
/* Declared in readelflib.c. */
extern int process_elf_file (const char *file_name, const char *lib, int *flag,
- char **soname, void *file_contents);
+ char **soname, void *file_contents,
+ size_t file_length);
/* Declared in ldconfig.c. */
diff --git a/elf/readlib.c b/elf/readlib.c
index 580d802..1914267 100644
--- a/elf/readlib.c
+++ b/elf/readlib.c
@@ -35,6 +35,7 @@
#include <sys/mman.h>
#include <sys/stat.h>
+#include <gnu/lib-names.h>
#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: