File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -1011,6 +1011,7 @@ void ElfFile<ElfFileParamNames>::normalizeNoteSegments()
10111011 [this ](std::pair<const std::string, std::string> & i) { return rdi (findSection (i.first ).sh_type ) == SHT_NOTE; });
10121012 if (!replaced_note) return ;
10131013
1014+ std::vector<Elf_Phdr> newPhdrs;
10141015 for (auto & phdr : phdrs) {
10151016 if (rdi (phdr.p_type ) != PT_NOTE) continue ;
10161017
@@ -1047,11 +1048,13 @@ void ElfFile<ElfFileParamNames>::normalizeNoteSegments()
10471048 if (curr_off == start_off)
10481049 phdr = new_phdr;
10491050 else
1050- phdrs .push_back (new_phdr);
1051+ newPhdrs .push_back (new_phdr);
10511052
10521053 curr_off += size;
10531054 }
10541055 }
1056+ phdrs.insert (phdrs.end (), newPhdrs.begin (), newPhdrs.end ());
1057+
10551058 wri (hdr->e_phnum , phdrs.size ());
10561059}
10571060
You can’t perform that action at this time.
0 commit comments