shithub: rgbds

Download patch

ref: c00f7409ee165b19ecb6ca6c3d366fd376ab06f8
parent: 92449a4fe4f13a8e45f0589985351b80a45fa941
author: Antonio Niño Díaz <[email protected]>
date: Sat Jul 22 11:16:43 EDT 2017

Improve linker symbol redefinition error messages

Now, the object file in which each definition is (as well as the source
file and line) are printed with the error message.

Signed-off-by: Antonio Niño Díaz <[email protected]>

--- a/src/link/symbol.c
+++ b/src/link/symbol.c
@@ -95,7 +95,10 @@
 			if (nBank == -1)
 				return;
 
-			errx(1, "Symbol '%s' defined more than once", tzName);
+			errx(1, "'%s' in both %s : %s(%d) and %s : %s(%d)",
+				tzName, tzObjFileName, tzFileName, nFileLine,
+				(*ppSym)->tzObjFileName,
+				(*ppSym)->tzFileName, (*ppSym)->nFileLine);
 		}
 	}