Skip to content

Commit d2e81f0

Browse files
authored
Merge pull request #242 from pablogsal/addr
Use sh_offset instead of sh_addr when checking already replaced libs
2 parents 5cd4517 + 83aa89a commit d2e81f0

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
@@ -778,7 +778,7 @@ void ElfFile<ElfFileParamNames>::rewriteSectionsLibrary()
778778
/* Some sections may already be replaced so account for that */
779779
unsigned int i = 1;
780780
Elf_Addr pht_size = sizeof(Elf_Ehdr) + (phdrs.size() + num_notes + 1)*sizeof(Elf_Phdr);
781-
while( shdrs[i].sh_addr <= pht_size && i < rdi(hdr->e_shnum) ) {
781+
while( shdrs[i].sh_offset <= pht_size && i < rdi(hdr->e_shnum) ) {
782782
if (not haveReplacedSection(getSectionName(shdrs[i])))
783783
replaceSection(getSectionName(shdrs[i]), shdrs[i].sh_size);
784784
i++;

0 commit comments

Comments
 (0)