diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2022-07-03 14:14:17 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2022-07-03 14:14:17 +0200 |
| commit | 672a41a79cbcfa095d6951112d592354e0efbd5a (patch) | |
| tree | 3a0b361da40ab3cb2562f7e18e7de20a9018c93e /src | |
| parent | 48b881f4912bc795e0467e334e359e9876f73c4f (diff) | |
| download | box64-672a41a79cbcfa095d6951112d592354e0efbd5a.tar.gz box64-672a41a79cbcfa095d6951112d592354e0efbd5a.zip | |
Added support for R_X86_64_IRELATIVE reloc, along with a test for it (for #303)
Diffstat (limited to 'src')
| -rwxr-xr-x | src/elfs/elfloader.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/elfs/elfloader.c b/src/elfs/elfloader.c index 44582846..eacafa0d 100755 --- a/src/elfs/elfloader.c +++ b/src/elfs/elfloader.c @@ -620,6 +620,14 @@ int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, int bindnow, elfheader_t printf_dump(LOG_NEVER, "Apply %s R_X86_64_RELATIVE @%p (%p -> %p)\n", (bind==STB_LOCAL)?"Local":"Global", p, *(void**)p, (void*)(head->delta+ rela[i].r_addend)); *p = head->delta+ rela[i].r_addend; break; + case R_X86_64_IRELATIVE: + { + x64emu_t* emu = thread_get_emu(); + EmuCall(emu, head->delta+rela[i].r_addend); + printf_dump(LOG_NEVER, "Apply %s R_X86_64_IRELATIVE @%p (%p -> %p()=%p)\n", (bind==STB_LOCAL)?"Local":"Global", p, *(void**)p, (void*)(head->delta+ rela[i].r_addend), (void*)(R_RAX)); + *p = R_RAX; + } + break; case R_X86_64_COPY: globoffs = offs; globend = end; |