aboutsummaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
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 ecdbb14883..a94df64ad0 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 580d802301..1914267b93 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: