From 14e20e643515d4e7171f54e6d2fb78cf784f7d10 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 28 Apr 2023 17:13:37 +0200 Subject: Fix for local library open using dlopen that are then promoted to global with another dlopen (help java 17, probably other too) --- src/wrapped/wrappedlibdl.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/wrapped') diff --git a/src/wrapped/wrappedlibdl.c b/src/wrapped/wrappedlibdl.c index 9caaba56..350eb088 100755 --- a/src/wrapped/wrappedlibdl.c +++ b/src/wrapped/wrappedlibdl.c @@ -139,6 +139,8 @@ void* my_dlopen(x64emu_t* emu, void *filename, int flag) } IncRefCount(dl->dllibs[i].lib, emu); ++dl->dllibs[i].count; + if(!is_local && isLibLocal(dl->dllibs[i].lib)) + promoteLocalLibGlobal(dl->dllibs[i].lib); printf_dlsym(LOG_DEBUG, "dlopen: Recycling %s/%p count=%ld (dlopened=%ld, elf_index=%d)\n", rfilename, (void*)(i+1), dl->dllibs[i].count, dl->dllibs[i].dlopened, GetElfIndex(dl->dllibs[i].lib)); return (void*)(i+1); } -- cgit 1.4.1