From 569cf286ff79a10126b9f20f39fa8c64df9b8b25 Mon Sep 17 00:00:00 2001 From: Andrea Orru Date: Wed, 4 Oct 2017 15:24:06 +0200 Subject: [PATCH] Fix for LLD on linker scripts with empty sections --- deps/lld/ELF/LinkerScript.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/lld/ELF/LinkerScript.cpp b/deps/lld/ELF/LinkerScript.cpp index 8bdbd8db20..614f5e2c8b 100644 --- a/deps/lld/ELF/LinkerScript.cpp +++ b/deps/lld/ELF/LinkerScript.cpp @@ -751,7 +751,7 @@ void LinkerScript::adjustSectionsAfterSorting() { if (auto *Cmd = dyn_cast(Base)) { Cmd->MemRegion = findMemoryRegion(Cmd); // Handle align (e.g. ".foo : ALIGN(16) { ... }"). - if (Cmd->AlignExpr) + if (Cmd->AlignExpr && Cmd->Sec) Cmd->Sec->updateAlignment(Cmd->AlignExpr().getValue()); } }