From 1124001c681a92bc7e42f37478cc8d7bb80008f2 Mon Sep 17 00:00:00 2001 From: George Rimar Date: Tue, 6 Jun 2017 07:46:28 +0000 Subject: [ELF] - Early return from writeTo() if section is SHT_NOBITS. NFCi. That addresses port commit comments for https://reviews.llvm.org/D33646 llvm-svn: 304777 --- lld/ELF/LinkerScript.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lld/ELF/LinkerScript.cpp') diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 1ced3e8e8d7..5a10e8c634f 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -1099,6 +1099,9 @@ template void OutputSectionCommand::maybeCompress() { } template void OutputSectionCommand::writeTo(uint8_t *Buf) { + if (Sec->Type == SHT_NOBITS) + return; + Sec->Loc = Buf; // We may have already rendered compressed content when using @@ -1110,9 +1113,6 @@ template void OutputSectionCommand::writeTo(uint8_t *Buf) { return; } - if (Sec->Type == SHT_NOBITS) - return; - // Write leading padding. std::vector Sections; for (BaseCommand *Cmd : Commands) -- cgit v1.2.3