tmedicci commented on PR #2026:
URL: https://github.com/apache/nuttx-apps/pull/2026#issuecomment-2149654738

   @acassis and @nealef :
   
   The `_start` defined in ROM is defined under `PROVIDE`, which means that the 
system can override it. This is not the problem because we don't use it. Again, 
the issue is not related to xtensa's, it happens even for RISC-V, as I 
commented 
[here](https://github.com/apache/nuttx-apps/pull/2026#issuecomment-2140491451).
   
   Alan, adding the `_start` to the linker just provides the symbol with a 
wrong reference. Th point is why is this symbol being evaluated by the dynload 
test:
   
   ```
   #include <nuttx/compiler.h>
   #include <nuttx/symtab.h>
   
   extern void *_start;
   extern void *syslog;
   extern void *vsyslog;
   
   const struct symtab_s g_sot_exports[] = 
   {
     {"_start", &_start},
     {"syslog", &syslog},
     {"vsyslog", &vsyslog},
   };
   
   const int g_sot_nexports = sizeof(g_sot_exports) / sizeof(struct symtab_s);
   ```
   
   @nealef, both xtensa and RISC-V already define the entrypoint in 
[arch/xtensa/src/Makefile](https://github.com/apache/incubator-nuttx/blob/447cc9698f9c6e71c8e6af3e4f94f407dccad3ad/arch/xtensa/src/Makefile#L163)
 and 
[nuttx/arch/risc-v/src/Makefile](https://github.com/apache/incubator-nuttx/blob/a51ebeab4b260e29a187fba84d3e37a07f49c56e/arch/risc-v/src/Makefile#L110)
 and it is defined as `__start` (double `_`). The question is: why `_start` 
(single `_`) is used instead of `__start` (double `_`) in the dynload test app?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to