Skip to content

Commit

Permalink
Resolve #1003
Browse files Browse the repository at this point in the history
  • Loading branch information
romainthomas committed Dec 17, 2023
1 parent 3f2046e commit e6d3f28
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ELF/Binary.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,18 @@ void Binary::patch_relocations<ARCH::EM_386>(uint64_t from, uint64_t shift) {
case RELOC_i386::R_386_JUMP_SLOT:
case RELOC_i386::R_386_IRELATIVE:
case RELOC_i386::R_386_GLOB_DAT:
case RELOC_i386::R_386_32:
{
LIEF_DEBUG("Patch addend of {}", relocation);
patch_addend<uint32_t>(relocation, from, shift);
break;
}
case RELOC_i386::R_386_TLS_DTPMOD32:
case RELOC_i386::R_386_TLS_DTPOFF32:
{
// Nothing to do for these relocations
continue;
}

default:
{
Expand Down Expand Up @@ -275,7 +282,7 @@ void Binary::patch_addend(Relocation& relocation, uint64_t from, uint64_t shift)
return;
}

T value = segment->get_content_value<T>(relative_offset);
auto value = segment->get_content_value<T>(relative_offset);

if (value >= from) {
value += shift;
Expand Down

0 comments on commit e6d3f28

Please sign in to comment.