mirror of
https://github.com/ptitSeb/box86.git
synced 2025-02-21 15:22:16 +00:00
Another attempt to make the function to find versionned symbol more resiliant (should help #548)
This commit is contained in:
parent
135e8d98e9
commit
88642d81c0
@ -1678,14 +1678,15 @@ int dl_iterate_phdr_findsymbol(struct dl_phdr_info* info, size_t size, void* dat
|
||||
ElfW(Verdef)* v = verdef;
|
||||
for(int k=0; k<verdef_cnt; ++k) {
|
||||
ElfW(Verdaux)* vda = (ElfW(Verdaux)*)(((uintptr_t)v) + v->vd_aux);
|
||||
for(int i=0; i<v->vd_cnt; ++i) {
|
||||
const char* vername = &strtab[vda->vda_name];
|
||||
if(vername && (s->addr = dlvsym(s->lib, s->name, vername))) {
|
||||
printf_log(LOG_DEBUG, "Found symbol with version %s, value = %p\n", vername, s->addr);
|
||||
return 1; // stop searching
|
||||
if(v->vd_version>0 && !v->vd_flags)
|
||||
for(int i=0; i<v->vd_cnt; ++i) {
|
||||
const char* vername = &strtab[vda->vda_name];
|
||||
if(vername && (s->addr = dlvsym(s->lib, s->name, vername))) {
|
||||
printf_log(LOG_DEBUG, "Found symbol with version %s, value = %p\n", vername, s->addr);
|
||||
return 1; // stop searching
|
||||
}
|
||||
vda = (ElfW(Verdaux)*)(((uintptr_t)vda) + vda->vda_next);
|
||||
}
|
||||
vda = (ElfW(Verdaux)*)(((uintptr_t)vda) + vda->vda_next);
|
||||
}
|
||||
v = (ElfW(Verdef)*)((uintptr_t)v + v->vd_next);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user