commit 569cf286ff79a10126b9f20f39fa8c64df9b8b25 (tree)
parent 522b431057d1e03d3068a9880745ccdfc923212e
Author: Andrea Orru <andreaorru1991@gmail.com>
Date: Wed, 4 Oct 2017 15:24:06 +0200
Fix for LLD on linker scripts with empty sections
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/deps/lld/ELF/LinkerScript.cpp b/deps/lld/ELF/LinkerScript.cpp
@@ -751,7 +751,7 @@ void LinkerScript::adjustSectionsAfterSorting() {
if (auto *Cmd = dyn_cast<OutputSectionCommand>(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());
}
}