summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDomen Kožar <domen@dev.si>2020-06-03 14:01:03 (GMT)
committerGitHub <noreply@github.com>2020-06-03 14:01:03 (GMT)
commit640a35faaa9ec36cdc502126dddd8837c8a6e1f2 (patch)
tree5bff5586e2b04b8e7b90d6c281a1ed6b20d04486
parent6dfc3c20a9788e9f6897a56d0f64377ce9fb87be (diff)
parentad5f1f078b716802dfb8f7226cb1d5c720348a78 (diff)
downloadpatchelf-640a35faaa9ec36cdc502126dddd8837c8a6e1f2.zip
patchelf-640a35faaa9ec36cdc502126dddd8837c8a6e1f2.tar.gz
patchelf-640a35faaa9ec36cdc502126dddd8837c8a6e1f2.tar.bz2
Merge pull request #202 from rpurdie/master
Fix shared library corruption when rerunning patchelf
-rw-r--r--src/patchelf.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/patchelf.cc b/src/patchelf.cc
index cbf420d..f3b8a45 100644
--- a/src/patchelf.cc
+++ b/src/patchelf.cc
@@ -752,6 +752,7 @@ void ElfFile<ElfFileParamNames>::rewriteSectionsLibrary()
}
/* Add a segment that maps the replaced sections into memory. */
+ wri(hdr->e_phoff, sizeof(Elf_Ehdr));
phdrs.resize(rdi(hdr->e_phnum) + 1);
wri(hdr->e_phnum, rdi(hdr->e_phnum) + 1);
Elf_Phdr & phdr = phdrs[rdi(hdr->e_phnum) - 1];