Skip to content

Commit a992616

Browse files
authored
Merge pull request #365 from a-m-joseph/master
fix incorrect polarity on dyn_offset; closes #364
2 parents 8fc7020 + 457d297 commit a992616

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/patchelf.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ void ElfFile<ElfFileParamNames>::rewriteHeaders(Elf_Addr phdrAddress)
10211021
if (shdr) {
10221022
auto rld_map_addr = findSectionHeader(".rld_map").sh_addr;
10231023
auto dyn_offset = ((char*)dyn) - ((char*)dyn_table);
1024-
dyn->d_un.d_ptr = rld_map_addr + dyn_offset - (*shdrDynamic).get().sh_addr;
1024+
dyn->d_un.d_ptr = rld_map_addr - dyn_offset - (*shdrDynamic).get().sh_addr;
10251025
} else {
10261026
/* ELF file with DT_MIPS_RLD_MAP_REL but without .rld_map
10271027
is broken, and it's not our job to fix it; yet, we have

0 commit comments

Comments
 (0)