diff lwlink/script.c @ 183:c6a38fd8bd33

Added --entry option for lwlink
author lost@l-w.ca
date Thu, 22 Dec 2011 18:01:59 -0700
parents 3b58d76ea032
children d389adbcc4ab
line wrap: on
line diff
--- a/lwlink/script.c	Wed Sep 21 21:14:09 2011 -0600
+++ b/lwlink/script.c	Thu Dec 22 18:01:59 2011 -0700
@@ -326,4 +326,25 @@
 	
 	if (scriptfile || nscriptls)
 		lw_free(oscript);
+	
+	if (entrysym)
+	{
+			int eaddr;
+			char *ptr2;
+			
+			lw_free(linkscript.execsym);
+			
+			eaddr = strtol(entrysym, &ptr2, 0);
+			if (*ptr2)
+			{
+				linkscript.execaddr = -1;
+				linkscript.execsym = lw_strdup(entrysym);
+			}
+			else
+			{
+				linkscript.execaddr = eaddr;
+				linkscript.execsym = NULL;
+			}
+
+	}
 }