diff lwasm/pseudo.c @ 243:f9f01a499525 2.x

Added zero-width external references
author lost
date Tue, 15 Sep 2009 03:16:17 +0000
parents 31231d1c87e6
children c7a41b4c89b3
line wrap: on
line diff
--- a/lwasm/pseudo.c	Sun Aug 16 18:34:13 2009 +0000
+++ b/lwasm/pseudo.c	Tue Sep 15 03:16:17 2009 +0000
@@ -1211,6 +1211,26 @@
 		register_error(as, l, 1, "Bad import list");
 }
 
+OPFUNC(pseudo_extdep)
+{
+	if (as -> passnum != 1)
+		return;
+
+	if (as -> outformat != OUTPUT_OBJ)
+	{
+		register_error(as, l, 1, "External references only supported for obj target");
+		return;
+	}
+	
+	if (l -> sym)
+	{
+		// add symbol to the "ext dep" list
+		as -> extdeps = lwasm_realloc(as -> extdeps, sizeof(char *) * (as -> nextdeps + 1));
+		as -> extdeps[as -> nextdeps++] = lwasm_strdup(l -> sym);
+		return;
+	}
+}
+
 OPFUNC(pseudo_export)
 {
 	lwasm_symbol_ent_t *se;