changeset 534:558ee362437e

Explicitly check for number (leading digit) for entry symbols (lwlink) Make entry symbol parsing match the description in the manual. If a leading digit is present, treat it as a number and don't try falling back to a symbol. Otherwise treat it as a symbol. This should be more predictable.
author William Astle <lost@l-w.ca>
date Sat, 14 May 2022 13:05:43 -0600
parents 543b5d1341d2
children a584b9ddffc4
files lwlink/script.c
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lwlink/script.c	Sat May 14 12:57:50 2022 -0600
+++ b/lwlink/script.c	Sat May 14 13:05:43 2022 -0600
@@ -493,17 +493,17 @@
 			
 			lw_free(linkscript.execsym);
 			
-			eaddr = strtol(entrysym, &ptr2, 16);
-			if (*ptr2)
+			if (entrysym[0] >= '0' && entrysym[0] <= '9')
+			{
+				eaddr = strtol(entrysym, &ptr2, 16);
+				linkscript.execaddr = eaddr;
+				linkscript.execsym = NULL;
+			}
+			else
 			{
 				linkscript.execaddr = -1;
 				linkscript.execsym = lw_strdup(entrysym);
 			}
-			else
-			{
-				linkscript.execaddr = eaddr;
-				linkscript.execsym = NULL;
-			}
 
 	}
 }