Skip to content

Commit

Permalink
Some adjustements to elfloader needed libs loading
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed May 31, 2021
1 parent 0d42b42 commit 6b05e42
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/librarian/librarian.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,14 @@ static void MapLibAddMapLib(lib_t* dest, library_t* lib_src, lib_t* src)
library_t *owner = src->owner;
for(int i=0; i<src->libsz; ++i) {
library_t* lib = src->libraries[i];
if(!lib) continue;
if(!lib || libraryInMapLib(dest, lib)) continue;
MapLibAddLib(dest, lib);
if(lib->maplib && src!=lib->maplib && dest!=lib->maplib) {
MapLibAddMapLib(dest, lib, lib->maplib);
MapLibRemoveLib(src, lib);
if(lib->maplib)
lib->maplib = (dest==my_context->maplib)?NULL:dest;
}
if(!libraryInMapLib(dest, lib))
MapLibAddLib(dest, lib);
}
if(lib_src == owner)
FreeLibrarian(&src, NULL);
Expand Down Expand Up @@ -327,13 +326,18 @@ int AddNeededLib(lib_t* maplib, needed_libs_t* neededlibs, library_t* deplib, in
int idx = neededlibs->size;
// Add libs and symbol
for(int i=0; i<npath; ++i) {
if(AddNeededLib_add(maplib, neededlibs, deplib, local, paths[i], box86, emu))
if(AddNeededLib_add(maplib, neededlibs, deplib, local, paths[i], box86, emu)) {
printf_log(LOG_INFO, "Error loading needed lib %s\n", paths[i]);
return 1;
}
}
int idx_end = neededlibs->size;
// add dependant libs and init them
for (int i=idx; i<neededlibs->size; ++i)
if(AddNeededLib_init(maplib, neededlibs, deplib, local, neededlibs->libs[i], box86, emu))
for (int i=idx; i<idx_end; ++i)
if(AddNeededLib_init(maplib, neededlibs, deplib, local, neededlibs->libs[i], box86, emu)) {
printf_log(LOG_INFO, "Error initializing needed lib %s\n", neededlibs->libs[i]->name);
if(!allow_missing_libs) return 1;
}
return 0;
}

Expand Down

0 comments on commit 6b05e42

Please sign in to comment.