diff options
Diffstat (limited to 'lld/ELF')
| -rw-r--r-- | lld/ELF/Writer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 60f5ff9d19f..77ef2525ef6 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -1675,9 +1675,9 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() { // particularly relevant. Out::ElfHeader->SectionIndex = 1; - unsigned I = 1; - for (OutputSection *Sec : OutputSections) { - Sec->SectionIndex = I++; + for (size_t I = 0, E = OutputSections.size(); I != E; ++I) { + OutputSection *Sec = OutputSections[I]; + Sec->SectionIndex = I + 1; Sec->ShName = In.ShStrTab->addString(Sec->Name); } |

