Skip to content

Commit

Permalink
Merge pull request #365 from a-m-joseph/master
Browse files Browse the repository at this point in the history
fix incorrect polarity on dyn_offset; closes #364
  • Loading branch information
Mic92 authored Feb 5, 2022
2 parents 8fc7020 + 457d297 commit a992616
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/patchelf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ void ElfFile<ElfFileParamNames>::rewriteHeaders(Elf_Addr phdrAddress)
if (shdr) {
auto rld_map_addr = findSectionHeader(".rld_map").sh_addr;
auto dyn_offset = ((char*)dyn) - ((char*)dyn_table);
dyn->d_un.d_ptr = rld_map_addr + dyn_offset - (*shdrDynamic).get().sh_addr;
dyn->d_un.d_ptr = rld_map_addr - dyn_offset - (*shdrDynamic).get().sh_addr;
} else {
/* ELF file with DT_MIPS_RLD_MAP_REL but without .rld_map
is broken, and it's not our job to fix it; yet, we have
Expand Down

0 comments on commit a992616

Please sign in to comment.