diff src/pseudo.c @ 82:03be43ae19cf

Added EXTERN directive
author lost
date Sat, 10 Jan 2009 22:24:29 +0000
parents d0ce3f5f6797
children 918be0c02239
line wrap: on
line diff
--- a/src/pseudo.c	Sat Jan 10 19:05:15 2009 +0000
+++ b/src/pseudo.c	Sat Jan 10 22:24:29 2009 +0000
@@ -761,3 +761,23 @@
 	as -> csect = 0;
 	as -> context = lwasm_next_context(as);
 }
+
+OPFUNC(pseudo_extern)
+{
+	if (as -> passnum != 1)
+		return;
+
+	if (as -> outformat != OUTPUT_OBJ)
+	{
+		register_error(as, l, 1, "External references only supported for obj target");
+		return;
+	}
+	
+	if (as -> csect)
+	{
+		register_error(as, l, 1, "Cannot declare external symbols within a section");
+		return;
+	}
+	
+	lwasm_register_symbol(as, l, l -> sym, 0, SYMBOL_EXTERN);
+}