diff options
| -rw-r--r-- | lld/ELF/OutputSections.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index b04d969548d..761d2316b50 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -604,15 +604,11 @@ template <class ELFT> void MergeOutputSection<ELFT>::finalize() { // finalize() fixed tail-optimized strings, so we can now get // offsets of strings. Get an offset for each string and save it // to a corresponding StringPiece for easy access. - if (shouldTailMerge()) { - for (MergeInputSection<ELFT> *Sec : Sections) { - for (size_t I = 0, E = Sec->Pieces.size(); I != E; ++I) { - if (!Sec->Pieces[I].Live) - continue; - Sec->Pieces[I].OutputOff = Builder.getOffset(Sec->getData(I)); - } - } - } + if (shouldTailMerge()) + for (MergeInputSection<ELFT> *Sec : Sections) + for (size_t I = 0, E = Sec->Pieces.size(); I != E; ++I) + if (Sec->Pieces[I].Live) + Sec->Pieces[I].OutputOff = Builder.getOffset(Sec->getData(I)); } template <class ELFT> |

