From c2be0268b1fb96741c5a98b5b6c3a270d14e2c83 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sat, 21 Sep 2024 15:52:02 +0200 Subject: [PATCH] [BOX32][ELFLOADER] Fixed PROTECTED symbol that were not loaded correctly --- src/elfs/elfloader32.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/elfs/elfloader32.c b/src/elfs/elfloader32.c index 0fdb23e5c..3b9ae080b 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) {