about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-04-02 13:36:03 +0200
committerptitSeb <sebastien.chev@gmail.com>2021-04-02 13:36:03 +0200
commitc6c6bfcf2c6aae86d34c29cee3e73031305a72da (patch)
treeda058b4eb9954870096be7bffe0d4a039cd7fa77 /src
parent4f451ff65365619f15073ebbbe5bc995a9a057c7 (diff)
downloadbox64-c6c6bfcf2c6aae86d34c29cee3e73031305a72da.tar.gz
box64-c6c6bfcf2c6aae86d34c29cee3e73031305a72da.zip
Minor change to elfloader
Diffstat (limited to 'src')
-rwxr-xr-xsrc/elfs/elfloader.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/elfs/elfloader.c b/src/elfs/elfloader.c
index a291d21f..cf21f8eb 100755
--- a/src/elfs/elfloader.c
+++ b/src/elfs/elfloader.c
@@ -580,7 +580,8 @@ int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, elfheader_t* head, int c
                 if(offs) {
                     // add r_addend to p?
                     printf_log(LOG_DUMP, "Apply R_X86_64_COPY @%p with sym=%s, @%p size=%ld\n", p, symname, (void*)offs, sym->st_size);
-                    memmove(p, (void*)(offs+rela[i].r_addend), sym->st_size);
+                    if(p!=(void*)(offs+rela[i].r_addend))
+                        memmove(p, (void*)(offs+rela[i].r_addend), sym->st_size);
                 } else {
                     printf_log(LOG_NONE, "Error: Symbol %s not found, cannot apply RELA R_X86_64_COPY @%p (%p) in %s\n", symname, p, *(void**)p, head->name);
                 }