Skip to content

Commit 640a35f

Browse files
authored
Merge pull request #202 from rpurdie/master
Fix shared library corruption when rerunning patchelf
2 parents 6dfc3c2 + ad5f1f0 commit 640a35f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/patchelf.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,7 @@ void ElfFile<ElfFileParamNames>::rewriteSectionsLibrary()
752752
}
753753

754754
/* Add a segment that maps the replaced sections into memory. */
755+
wri(hdr->e_phoff, sizeof(Elf_Ehdr));
755756
phdrs.resize(rdi(hdr->e_phnum) + 1);
756757
wri(hdr->e_phnum, rdi(hdr->e_phnum) + 1);
757758
Elf_Phdr & phdr = phdrs[rdi(hdr->e_phnum) - 1];

0 commit comments

Comments
 (0)