From fa45407e78c7a20281bf063f659d74f86c127ea1 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 1 Dec 2017 12:08:16 -0500 Subject: [PATCH] LLD patch: Fix for LLD on linker scripts with empty sections This reapplies 569cf286ff79a10126b9f20f39fa8c64df9b8b25 to the embedded LLD. --- 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 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()); } } -- 2.54.0