# HG changeset patch # User William Astle # Date 1652555143 21600 # Node ID 558ee362437ed400fc3e22bfb93c25f5042d754f # Parent 543b5d1341d229ae0c0f3f53d8a4b0b0f5839b89 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. diff -r 543b5d1341d2 -r 558ee362437e lwlink/script.c --- 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; - } } }