casaroli commented on code in PR #20368: URL: https://github.com/apache/nuttx/pull/20368#discussion_r4130302236
########## libs/libc/elf/elf_bind.c: ########## @@ -46,6 +47,14 @@ * Pre-processor Definitions ****************************************************************************/ +/* With an address environment the program lives in its own address space, + * which a library loaded by libelf_insert() cannot reach. Review Comment: Without this guard `qemu-armv8a:knsh` does not link. We could fix ld-kernel.script for `qemu-armv8a` so that it links, but `DT_NEEDED` would still not work: `libelf_insert()` loads the library into kernel memory, which the task's address environment does not map. Ideally the library is loaded only once and mapped into each task that needs it. That needs reference counting across tasks and a much larger design change, so I would like to do it in follow-up PRs. The other option is to load the library into the task's own address space, but then a library used by several tasks is copied into every one of them. -- 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]
