diff options
Diffstat (limited to 'lld/ELF/Writer.cpp')
-rw-r--r-- | lld/ELF/Writer.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index ce5ef0229a9..8045e086ffa 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -527,10 +527,11 @@ template <class ELFT> void Writer<ELFT>::addSectionSymbols() { // Create one STT_SECTION symbol for each output section we might // have a relocation with. for (OutputSection *Sec : OutputSections) { - InputSection *IS = nullptr; - if (!Sec->Sections.empty()) - IS = Sec->Sections[0]; - if (!IS || isa<SyntheticSection>(IS) || IS->Type == SHT_REL || + if (Sec->Sections.empty()) + continue; + + InputSection *IS = Sec->Sections[0]; + if (isa<SyntheticSection>(IS) || IS->Type == SHT_REL || IS->Type == SHT_RELA) continue; |