pkarashchenko commented on code in PR #10110:
URL: https://github.com/apache/nuttx/pull/10110#discussion_r1287074970
##########
arch/risc-v/src/esp32c3/esp32c3_libc_stubs.c:
##########
@@ -59,12 +60,12 @@ struct _reent;
int _close_r(struct _reent *r, int fd)
{
- return close(fd);
+ return nx_close(fd);
Review Comment:
> > Only one thing that I would like to highlight that for example
`esp32_rom.ld` provides symbols `PROVIDE ( asprintf = 0x40056d9c );` and
`PROVIDE ( strdup = 0x4000143c );` so if kernel code will link with it the
memory allocation will most probably be done by newlib via `_malloc_r`
implemented in this file and will lead to kernel memory allocation.
>
> The symbols included via `PROVIDE` keyword behave as weak references, so
`asprintf` and `strdup` from NuttX `libkc.a` will prevail in the Kernel image.
>
> https://sourceware.org/binutils/docs/ld/PROVIDE.html
Ok. Anyway going with `lib_malloc`/`lib_free` here seems to be fine.
--
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]