changeset 201:7824f94c5786

take 2: importing undefined exports
author lost
date Sun, 22 Mar 2009 20:07:37 +0000
parents 3f9d299d2477
children 1a75121c3c3f
files lwasm/pseudo.c
diffstat 1 files changed, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lwasm/pseudo.c	Sun Mar 22 19:26:26 2009 +0000
+++ b/lwasm/pseudo.c	Sun Mar 22 20:07:37 2009 +0000
@@ -1084,18 +1084,15 @@
 	se = lwasm_find_symbol(as, l -> sym, -1);
 	if (!se && (as -> pragmas & PRAGMA_IMPORTUNDEFEXPORT))
 	{
-		// import the symbol
-		if (as -> csect)
-		{
-			register_error(as, l, 1, "Cannot declare external symbols within a section");
-			return;
-		}
-	
+		void *p;
+		p = as -> csect;
+		as -> csect = NULL;
 		lwasm_register_symbol(as, l, l -> sym, 0, SYMBOL_EXTERN);
+		as -> csect = p;
 	}
 	else
 	{
-	if (!se)
+		if (!se)
 		{
 			register_error(as, l, 2, "Exported symbols must be fully defined within a section");
 			return;