proper path searching for dynamic linker

first, use $LD_LIBRARY_PATH unless suid. if that fails, read path from
/etc/ld-musl-$ARCH.path and fallback to a builtin default.
This commit is contained in:
Rich Felker 2011-06-25 01:56:34 -04:00
commit 568b8075a4
3 changed files with 42 additions and 14 deletions

View file

@ -1,6 +1,8 @@
#include <string.h>
#include <elf.h>
#define ETC_LDSO_PATH "/etc/ld-musl-i386.path"
#define IS_COPY(x) ((x)==R_386_COPY)
static inline void do_single_reloc(size_t *reloc_addr, int type, size_t sym_val, size_t sym_size, unsigned char *base_addr, size_t addend)

View file

@ -2,6 +2,8 @@
#include <string.h>
#include <elf.h>
#define ETC_LDSO_PATH "/etc/ld-musl-x86_64.path"
#define IS_COPY(x) ((x)==R_X86_64_COPY)
static inline void do_single_reloc(size_t *reloc_addr, int type, size_t sym_val, size_t sym_size, unsigned char *base_addr, size_t addend)