Blob Blame History Raw
From 788fbcc9c8cdd88ecaf6baacef9cd347e406b0fd Mon Sep 17 00:00:00 2001
From: bbbradsmith <bbbradsmith@users.noreply.github.com>
Date: Sun, 17 Nov 2019 03:45:32 -0500
Subject: [PATCH 097/170] Fix silent crash failure on warning from linker
 command line define import size mismatch

---
 src/ld65/exports.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/ld65/exports.c b/src/ld65/exports.c
index b83d8b49..be14f748 100644
--- a/src/ld65/exports.c
+++ b/src/ld65/exports.c
@@ -694,10 +694,15 @@ static void CheckSymType (const Export* E)
                            GetString (E->Obj->Name),
                            GetSourceName (ExportLI),
                            GetSourceLine (ExportLI));
-            } else {
+            } else if (ExportLI) {
                 SB_Printf (&ExportLoc, "%s(%u)",
                            GetSourceName (ExportLI),
                            GetSourceLine (ExportLI));
+            } else {
+                /* The export is linker generated and we don't have line
+                ** information (likely from command line define)
+                */
+                SB_Printf (&ExportLoc, "linker");
             }
             if (I->Obj) {
                 /* The import comes from an object file */
-- 
2.26.0