summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatrixLing <210271138@qq.com>2021-04-12 09:25:35 +0800
committerMatrixLing <210271138@qq.com>2021-04-12 09:25:35 +0800
commitff6f21fad581385f6ac3d60e8899a40932072743 (patch)
tree94703db861439f9e3ae3845e47ab92f6252ea507
parentf376fe61bae57e9e50f4622f5a44febb4f5bfd3c (diff)
fixed phdr bug
-rw-r--r--src/patchelf.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/patchelf.cc b/src/patchelf.cc
index 287fea8..5c8b5c0 100644
--- a/src/patchelf.cc
+++ b/src/patchelf.cc
@@ -1057,7 +1057,7 @@ void ElfFile<ElfFileParamNames>::rewriteHeaders(Elf_Addr phdrAddress)
/* If there is a segment for the program header table, update it.
(According to the ELF spec, there can only be one.) */
- for (auto phdr : phdrs) {
+ for (auto &phdr : phdrs) {
if (rdi(phdr.p_type) == PT_PHDR) {
phdr.p_offset = hdr->e_phoff;
wri(phdr.p_vaddr, wri(phdr.p_paddr, phdrAddress));