From 18c47843f1c4ed3e9c480559bccf5f8a059ddd97 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Wed, 12 Feb 2020 15:27:07 +0100 Subject: [PATCH] Check if sections referenced in linker script exist --- src/link/script.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/link/script.c b/src/link/script.c index 368f52e3..bff3ec53 100644 --- a/src/link/script.c +++ b/src/link/script.c @@ -419,6 +419,10 @@ struct SectionPlacement *script_NextSection(void) section.section = sect_GetSection(token->attr.string); + if (!section.section) + errx(1, "%s(%u): Unknown section \"%s\"", + linkerScriptName, lineNo, + token->attr.string); section.org = curaddr[type][bankID]; section.bank = bank;