From e558912a360809cd90796b061e3001c9ade5dba7 Mon Sep 17 00:00:00 2001 From: KreitinnSoftware <80591934+KreitinnSoftware@users.noreply.github.com> Date: Sun, 1 Oct 2023 14:25:03 -0300 Subject: [ANDROID] Remove PreInit Array Warning and Fix libdl name (#1001) --- src/elfs/elfparser.c | 6 ++++-- src/main.c | 6 +++++- src/wrapped/wrappedlibdl.c | 6 +++++- 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/elfs/elfparser.c b/src/elfs/elfparser.c index 61799dae..994581f6 100644 --- a/src/elfs/elfparser.c +++ b/src/elfs/elfparser.c @@ -247,8 +247,10 @@ elfheader_t* ParseElfHeader(FILE* f, const char* name, int exec) printf_dump(LOG_DEBUG, "The DT_INIT_ARRAYSZ is %zu\n", h->initarray_sz); break; case DT_PREINIT_ARRAYSZ: - if(val) - printf_log(LOG_NONE, "Warning, PreInit Array (size=%d) present and ignored!\n", val); + #ifndef ANDROID + if(val) + printf_log(LOG_NONE, "Warning, PreInit Array (size=%d) present and ignored!\n", val); + #endif break; case DT_FINI: // Exit hook h->finientry = ptr; diff --git a/src/main.c b/src/main.c index e7957bf5..90e3575d 100644 --- a/src/main.c +++ b/src/main.c @@ -1532,7 +1532,11 @@ int main(int argc, const char **argv, char **env) { else ++prgname; if(box64_wine) { - AddPath("libdl.so.2", &ld_preload, 0); + #ifdef ANDROID + AddPath("libdl.so", &ld_preload, 0); + #else + AddPath("libdl.so.2", &ld_preload, 0); + #endif } // special case for zoom if(strstr(prgname, "zoom")==prgname) { diff --git a/src/wrapped/wrappedlibdl.c b/src/wrapped/wrappedlibdl.c index 9ed55135..217ae012 100644 --- a/src/wrapped/wrappedlibdl.c +++ b/src/wrapped/wrappedlibdl.c @@ -57,7 +57,11 @@ void* my_dlvsym(x64emu_t* emu, void *handle, void *symbol, const char *vername) int my_dlinfo(x64emu_t* emu, void* handle, int request, void* info) EXPORT; #define LIBNAME libdl -const char* libdlName = "libdl.so.2"; +#ifdef ANDROID + const char* libdlName = "libdl.so"; +#else + const char* libdlName = "libdl.so.2"; +#endif #define CLEARERR if(dl->last_error) {box_free(dl->last_error); dl->last_error = NULL;} -- cgit 1.4.1