diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2023-06-04 12:01:58 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2023-06-04 12:01:58 +0200 |
| commit | f4c8c295107e0c1af7c3ef033d5880daca61992c (patch) | |
| tree | eee69db9c6833d7a9a26ec9715d2369163170b3d /src/elfs/elfloader.c | |
| parent | 87be9fd1ad3c743bbc109e2e4e0bd79a04d83d14 (diff) | |
| download | box64-f4c8c295107e0c1af7c3ef033d5880daca61992c.tar.gz box64-f4c8c295107e0c1af7c3ef033d5880daca61992c.zip | |
[ELF_LOAD] Also use SONAME of loaded elf to match loaded libs (helps #805)
Diffstat (limited to 'src/elfs/elfloader.c')
| -rwxr-xr-x | src/elfs/elfloader.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/elfs/elfloader.c b/src/elfs/elfloader.c index 310bb2f7..e10de870 100755 --- a/src/elfs/elfloader.c +++ b/src/elfs/elfloader.c @@ -1184,9 +1184,13 @@ int LoadNeededLibs(elfheader_t* h, lib_t *maplib, int local, int bindnow, box64c DumpDynamicNeeded(h); int cnt = 0; - for (int i=0; i<h->numDynamic; ++i) + // count the number of needed libs, and also grab soname + for (int i=0; i<h->numDynamic; ++i) { if(h->Dynamic[i].d_tag==DT_NEEDED) ++cnt; + if(h->Dynamic[i].d_tag==DT_SONAME) + h->soname = h->DynStrTab+h->delta+h->Dynamic[i].d_un.d_val; + } h->needed = new_neededlib(cnt); if(h == my_context->elfs[0]) my_context->neededlibs = h->needed; |