From 7adaf39f1a7e1df0641f6425622899d363bf8cb5 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sun, 19 Jun 2022 15:28:13 +0200 Subject: Better handling of LD_PRELOAD libraries --- src/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main.c b/src/main.c index 9a75ee07..0e80523b 100755 --- a/src/main.c +++ b/src/main.c @@ -1334,9 +1334,10 @@ int main(int argc, const char **argv, char **env) { AddMainElfToLinkmap(elf_header); // pre-load lib if needed if(ld_preload.size) { - if(AddNeededLib(NULL, NULL, NULL, 0, 0, (const char**)ld_preload.paths, ld_preload.size, my_context, emu)) { - printf_log(LOG_INFO, "Warning, cannot pre-load a lib\n"); - } + for(int i=0; imaplib, &my_context->neededlibs, NULL, 0, 0, (const char**)&ld_preload.paths[i], 1, my_context, emu)) { + printf_log(LOG_INFO, "Warning, cannot pre-load a lib (%s)\n", ld_preload.paths[i]); + } } FreeCollection(&ld_preload); // Call librarian to load all dependant elf -- cgit 1.4.1