Skip to content
Permalink
Browse files

Merge PR #3230: overlay_gl: linux: only assume absolute dynamic entri…

…es on glibc.
  • Loading branch information...
mkrautz committed Nov 26, 2017
2 parents 2d89506 + 2903f3b commit 24e437c68a61253a7b323a4db11c85d12094e19c
Showing with 8 additions and 3 deletions.
  1. +8 −3 overlay_gl/init_unix.c
@@ -152,19 +152,24 @@ static int find_odlsym() {
int nchains = 0;
ElfW(Sym) *symtab = NULL;
const char *strtab = NULL;
#if defined(__GLIBC__)
const ElfW(Addr) base = 0;
#else
const ElfW(Addr) base = lm->l_addr;
#endif

ElfW(Dyn) *dyn = lm->l_ld;

while (dyn->d_tag) {
switch (dyn->d_tag) {
case DT_HASH:
nchains = *(int *)(dyn->d_un.d_ptr + 4);
nchains = *(int *)(base + dyn->d_un.d_ptr + 4);
break;
case DT_STRTAB:
strtab = (const char *) dyn->d_un.d_ptr;
strtab = (const char *)(base + dyn->d_un.d_ptr);
break;
case DT_SYMTAB:
symtab = (ElfW(Sym) *) dyn->d_un.d_ptr;
symtab = (ElfW(Sym) *)(base + dyn->d_un.d_ptr);
break;
}
dyn ++;

0 comments on commit 24e437c

Please sign in to comment.
You can’t perform that action at this time.