Mercurial > hg > index.cgi
comparison lwlink/script.c @ 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 | b8e9ac01deda |
children |
comparison
equal
deleted
inserted
replaced
533:543b5d1341d2 | 534:558ee362437e |
---|---|
491 int eaddr; | 491 int eaddr; |
492 char *ptr2; | 492 char *ptr2; |
493 | 493 |
494 lw_free(linkscript.execsym); | 494 lw_free(linkscript.execsym); |
495 | 495 |
496 eaddr = strtol(entrysym, &ptr2, 16); | 496 if (entrysym[0] >= '0' && entrysym[0] <= '9') |
497 if (*ptr2) | 497 { |
498 eaddr = strtol(entrysym, &ptr2, 16); | |
499 linkscript.execaddr = eaddr; | |
500 linkscript.execsym = NULL; | |
501 } | |
502 else | |
498 { | 503 { |
499 linkscript.execaddr = -1; | 504 linkscript.execaddr = -1; |
500 linkscript.execsym = lw_strdup(entrysym); | 505 linkscript.execsym = lw_strdup(entrysym); |
501 } | 506 } |
502 else | |
503 { | |
504 linkscript.execaddr = eaddr; | |
505 linkscript.execsym = NULL; | |
506 } | |
507 | 507 |
508 } | 508 } |
509 } | 509 } |