aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-12-01 12:08:16 -0500
committerAndrew Kelley <superjoe30@gmail.com>2017-12-01 12:08:16 -0500
commitfa45407e78c7a20281bf063f659d74f86c127ea1 (patch)
tree197855faee5e26d160a705f42fbd4f2260c10977
parent9ea23272fac7f4580d29f7ee557108883f127a5d (diff)
downloadzig-fa45407e78c7a20281bf063f659d74f86c127ea1.tar.gz
zig-fa45407e78c7a20281bf063f659d74f86c127ea1.zip
LLD patch: Fix for LLD on linker scripts with empty sections
This reapplies 569cf286ff79a10126b9f20f39fa8c64df9b8b25 to the embedded LLD.
-rw-r--r--deps/lld/ELF/LinkerScript.cpp2
1 files changed, 1 insertions, 1 deletions
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<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());
}
}