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:
parent
f937031800
commit
568b8075a4
3 changed files with 42 additions and 14 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue