about summary refs log tree commit diff stats
path: root/src/elfs
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2023-09-02 16:35:07 +0200
committerGitHub <noreply@github.com>2023-09-02 16:35:07 +0200
commit25a064f3a8da90626b8c33fc01bb1e1bd0b4c4c8 (patch)
treedc564c30b2155310cf82c7bd6a4664255fea4a6c /src/elfs
parenteb1e607b935a1c90c0c9cf0b352d95423e42740d (diff)
parent8a25b91ad23b8ef0c1154f43f95459209d372463 (diff)
downloadbox64-25a064f3a8da90626b8c33fc01bb1e1bd0b4c4c8.tar.gz
box64-25a064f3a8da90626b8c33fc01bb1e1bd0b4c4c8.zip
Merge pull request #962 from ptitSeb/android
[ANDROID] Try to create an Android build, porting box86 Android build
Diffstat (limited to 'src/elfs')
-rw-r--r--src/elfs/elfloader.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/elfs/elfloader.c b/src/elfs/elfloader.c
index 1f6f6c65..eb571325 100644
--- a/src/elfs/elfloader.c
+++ b/src/elfs/elfloader.c
@@ -1060,6 +1060,10 @@ uintptr_t GetLastByte(elfheader_t* h)
     return (uintptr_t)h->memory/* + h->delta*/ + h->memsz;
 }
 
+#ifndef STB_GNU_UNIQUE
+#define STB_GNU_UNIQUE	10
+#endif
+
 void checkHookedSymbols(elfheader_t* h); // in mallochook.c
 void AddSymbols(lib_t *maplib, kh_mapsymbols_t* mapsymbols, kh_mapsymbols_t* weaksymbols, kh_mapsymbols_t* localsymbols, elfheader_t* h)
 {
@@ -1391,6 +1395,10 @@ void RunElfFini(elfheader_t* h, x64emu_t *emu)
     if(!h || h->fini_done || !h->init_done)
         return;
     h->fini_done = 1;
+#ifdef ANDROID
+    // TODO: Fix .fini_array on Android
+    printf_log(LOG_DEBUG, "Android does not support Fini for %s\n", ElfName(h));
+#else
     // first check fini array
     Elf64_Addr *addr = (Elf64_Addr*)(h->finiarray + h->delta);
     for (int i=h->finiarray_sz-1; i>=0; --i) {
@@ -1405,6 +1413,7 @@ void RunElfFini(elfheader_t* h, x64emu_t *emu)
     }
     h->init_done = 0;   // can be re-inited again...
     return;
+#endif
 }
 
 uintptr_t GetElfInit(elfheader_t* h)