Fix for LLD on linker scripts with empty sections

This commit is contained in:
Andrea Orru 2017-10-04 15:24:06 +02:00
parent 522b431057
commit 569cf286ff

View File

@ -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());
}
}