diff --git a/deps/lld/ELF/LinkerScript.cpp b/deps/lld/ELF/LinkerScript.cpp index 8bdbd8db20addddeb2eb72d7cb9f5726a34034a7..614f5e2c8bd0ffcf4da2f849e34fc19034558b87 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()); } }