about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-09-21 15:52:02 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-09-21 15:52:02 +0200
commitc2be0268b1fb96741c5a98b5b6c3a270d14e2c83 (patch)
treec51fe2c8a433f38d6261f05d39815e203a9abd1a /src
parent4cda6dbcfbf376ef0a00e48b4310660e3cd9bc9f (diff)
downloadbox64-c2be0268b1fb96741c5a98b5b6c3a270d14e2c83.tar.gz
box64-c2be0268b1fb96741c5a98b5b6c3a270d14e2c83.zip
[BOX32][ELFLOADER] Fixed PROTECTED symbol that were not loaded correctly
Diffstat (limited to 'src')
-rw-r--r--src/elfs/elfloader32.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/elfs/elfloader32.c b/src/elfs/elfloader32.c
index 0fdb23e5..3b9ae080 100644
--- a/src/elfs/elfloader32.c
+++ b/src/elfs/elfloader32.c
@@ -435,6 +435,10 @@ static int RelocateElfREL(lib_t *maplib, lib_t *local_maplib, int bindnow, int d
         int vis = ELF64_ST_VISIBILITY(sym->st_other);
         if(vis==STV_PROTECTED) {
             elfsym = ElfDynSymLookup32(head, symname);
+            if(elfsym) {
+                offs = elfsym->st_value + head->delta;
+                end = offs + elfsym->st_size;
+            }
             printf_log(LOG_DEBUG, "Symbol %s from %s is PROTECTED\n", symname, head->name);
         } else {
             if(bind==STB_GNU_UNIQUE) {