diff lwlink/link.c @ 173:0395e6fd67e9

Fixed stupid errors with changes for archive handling
author lost
date Mon, 02 Mar 2009 04:13:49 +0000
parents d610b8aef91b
children 220a760ec654
line wrap: on
line diff
--- a/lwlink/link.c	Sun Mar 01 22:59:52 2009 +0000
+++ b/lwlink/link.c	Mon Mar 02 04:13:49 2009 +0000
@@ -52,7 +52,7 @@
 			nsects++;
 		}
 	}
-	for (sn = 0; sn < fn -> nsubs; fn++)
+	for (sn = 0; sn < fn -> nsubs; sn++)
 	{
 		check_section_name(name, base, fn -> subs[sn]);
 	}
@@ -79,7 +79,7 @@
 		
 		// and then continue looking for sections
 	}
-	for (sn = 0; sn < fn -> nsubs; fn++)
+	for (sn = 0; sn < fn -> nsubs; sn++)
 	{
 		check_section_flags(yesflags, noflags, base, fn -> subs[sn]);
 	}
@@ -273,11 +273,14 @@
 	{
 		// external symbol
 		// read all files in order until found (or not found)
-		for (fp = sect -> file; fp; fp = fp -> parent)
+		if (sect)
 		{
-			s = find_external_sym_recurse(sym, fp);
-			if (s)
-				return s;
+			for (fp = sect -> file; fp; fp = fp -> parent)
+			{
+				s = find_external_sym_recurse(sym, fp);
+				if (s)
+					return s;
+			}
 		}
 
 		for (fn = 0; fn < ninputfiles; fn++)