casaroli opened a new pull request, #19942:
URL: https://github.com/apache/nuttx/pull/19942

   depends-on: [apache/nuttx/pull/19938 apache/nuttx/pull/19939 
apache/nuttx/pull/19940 apache/nuttx/pull/19941]
   
   ## Summary
   
   Fifth of ten PRs that #19673 is being split into. This is the loader side: 
enough for the ELF loader to place an FDPIC object and bind it. The ARM 
relocations are `[6/10]`, the callback entry points `[7/10]`, the `exec()` path 
`[8/10]`, `DT_NEEDED` `[9/10]`, documentation and a board configuration 
`[10/10]`.
   
   An FDPIC object places its two `PT_LOAD` segments independently, so its 
read-only segment runs where the filesystem already holds it and only the 
writable segment is copied to RAM, once per running instance. Several instances 
of one module therefore share one copy of the text. A filesystem that cannot 
show its media gets the text copied to RAM instead, so the module still runs 
but shares nothing.
   
   The first commit adds `CONFIG_FDPIC`, `ARCH_HAVE_ELF_FDPIC` and 
`include/nuttx/fdpic.h`, so the four that follow each build on their own.
   
   The read-only segment needs the filesystem to hold its blocks still. A 
compacting filesystem such as XIPFS gives its media address together with a 
pin, which the loader holds through a file reference, because the unload runs 
on a different task from the load.
   
   ## Impact
   
   `CONFIG_FDPIC` defaults off and no in-tree configuration sets it, so nothing 
changes for anyone yet. With it off the four loader commits compile to what 
they were.
   
   The four PRs this depends on are not merged, so nine commits show here until 
they are.
   
   ## Testing
   
   `mps3-an547:bl` and `mps3-an547:picostest` build with `CONFIG_FDPIC` off, 
which is every configuration in the tree. `tools/checkpatch.sh` passes on each 
of the five commits.
   
   `mps3-an547:bl` is the one to keep an eye on: it sets 
`CONFIG_ARCH_USE_SEPARATED_SECTION`, and `CONFIG_LIBC_ELF` pulls in 
`ARCH_USE_TEXT_HEAP`, which selects the three argument 
`up_textheap_memalign()`. #19673 calls the two argument form there and fails to 
build; that is fixed in the commit that adds the call.
   
   Runtime evidence follows with `[6/10]`, since an FDPIC module cannot be 
relocated until the ARM relocations land. The full stack has been run on QEMU 
`mps2-an500` and on a Pimoroni Pico Plus 2: 131/131, 34/34 and 7/7, with the 
logs in #19673.
   


-- 
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