linker config), CheckExports was never called, which in turn meant that
the list of all exports was never built. This caused a crash later when
the linker tried to generate a map file. The solution is to separate the
creation of the exports list and the check for unresolved imports.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3360
b7a2c559-68d2-44c3-8de9-
860c34a00d81
* if we get an unresolved symbol.
*/
D->Undef = 0; /* Reset the counter */
- CheckExports (BinUnresolved, D);
+ CheckUnresolvedImports (BinUnresolved, D);
if (D->Undef > 0) {
/* We had unresolved symbols, cannot create output file */
Error ("%u unresolved external(s) found - cannot create output file", D->Undef);
/* */
/* */
/* */
-/* (C) 1998-2003 Ullrich von Bassewitz */
+/* (C) 1998-2005 Ullrich von Bassewitz */
/* Römerstraße 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
Warning ("Address size mismatch for `%s': Symbol is `%s'"
", but imported from %s, %s(%lu) as `%s'",
GetString (E->Name),
- ExpAddrSize,
+ ExpAddrSize,
ImpObjName,
GetSourceFileName (Imp->Obj, Imp->Pos.Name),
Imp->Pos.Line,
-void CheckExports (ExpCheckFunc F, void* Data)
-/* Check if there are any unresolved symbols. On unresolved symbols, F is
- * called (see the comments on ExpCheckFunc in the data section).
+void CheckExports (void)
+/* Setup the list of all exports and check for export/import symbol type
+ * mismatches.
*/
{
/* Create an export pool */
/* Check for symbol type mismatches */
CheckSymTypes ();
+}
+
- /* Check for unresolved externals (check here for special bin formats) */
+
+void CheckUnresolvedImports (ExpCheckFunc F, void* Data)
+/* Check if there are any unresolved imports. On unresolved imports, F is
+ * called (see the comments on ExpCheckFunc in the data section).
+ */
+{
+ /* Check for unresolved externals */
if (ImpOpen != 0) {
/* Print all open imports */
PrintUnresolved (F, Data);
long GetExportVal (const Export* E);
/* Get the value of this export */
-void CheckExports (ExpCheckFunc F, void* Data);
-/* Check if there are any unresolved symbols. On unresolved symbols, F is
+void CheckExports (void);
+/* Setup the list of all exports and check for export/import symbol type
+ * mismatches.
+ */
+
+void CheckUnresolvedImports (ExpCheckFunc F, void* Data);
+/* Check if there are any unresolved imports. On unresolved imports, F is
* called (see the comments on ExpCheckFunc in the data section).
*/
/* End of exports.h */
#endif
-
+
/* */
/* */
/* */
-/* (C) 1998-2003 Ullrich von Bassewitz */
+/* (C) 1998-2005 Ullrich von Bassewitz */
/* Römerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* Check module assertions */
CheckAssertions ();
+ /* Check for import/export mismatches */
+ CheckExports ();
+
/* Create the output file */
CfgWriteTarget ();
/* */
/* */
/* */
-/* (C) 1999-2003 Ullrich von Bassewitz */
+/* (C) 1999-2005 Ullrich von Bassewitz */
/* Römerstraße 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
* if we get an unresolved symbol.
*/
D->Undef = 0; /* Reset the counter */
- CheckExports (O65Unresolved, D);
+ CheckUnresolvedImports (O65Unresolved, D);
if (D->Undef > 0) {
/* We had unresolved symbols, cannot create output file */
Error ("%u unresolved external(s) found - cannot create output file", D->Undef);