examples/fdpicxip, testing/fs/xipfs: A DT_NEEDED library is one instance - #3693
Open
casaroli wants to merge 2 commits into
Open
examples/fdpicxip, testing/fs/xipfs: A DT_NEEDED library is one instance#3693casaroli wants to merge 2 commits into
casaroli wants to merge 2 commits into
Conversation
cederom
reviewed
Aug 3, 2026
| FDPICDIR = $(NUTTX_DIR)/tools/fdpic | ||
| MODULE_MK = $(FDPICDIR)/nuttx-fdpic.mk | ||
| EMBED = $(FDPICDIR)/fdpic-embed | ||
| EMBED = $(FDPICDIR)/fdpic-embed.py |
Contributor
There was a problem hiding this comment.
could we integrate fdpic special process into the post link after you corporate fdpic into elf binfmt?
Contributor
Author
There was a problem hiding this comment.
for building fdpic modules, we can do with stock gcc, however for linking them we need upstream binutils rebuilt with arm-uclinuxfdpiceabi-ld, as stock arm ld does not ship with it:
$ arm-none-eabi-ld -V
GNU ld (Arm GNU Toolchain 15.2.Rel1) 2.45.1
Supported emulations:
armelf
What do you suggest? can we include the "custom" binutils in the CI image?
xiaoxiang781216
approved these changes
Aug 4, 2026
The two helper scripts this Makefile names gained a file extension when tools/fdpic came into the nuttx tree: checkpatch rejects an executable file that is not .sh, .py or .bat. Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
…nce. Both the demo and the test asserted that each running instance of a module gets its own copy of a library named in DT_NEEDED: two instances adding their own seed each saw a total of seed*3. That was true of the loader that walked DT_NEEDED itself. The loader now hands the work to dlopen(), which returns the object already in the module registry rather than loading a second copy of it, so there is one library and one set of its globals, shared by every module that names it. The module's own data stays private per instance, because exec() loads the module afresh each time. What an instance can still assert on its own is that every add it made landed in the library, so that is what it checks; the totals interleave and the final one counts both. The test additionally checks the consequences: the library is pinned once rather than once per instance, and its destructor runs once, at the last close, holding what both instances built up. USER_FAIL_PRIVATE becomes USER_FAIL_SHARED rather than gaining a companion. The bit is a private protocol between cxxuser.cpp, which sets it, and testing/fs/xipfs, which reads it; nothing else names it, and the property it used to report no longer exists. Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
examples/fdpicxipandtesting/fs/xipfsassert that each running instance of a module gets its own copy of a library named inDT_NEEDED: two instances adding their own seed each saw a total ofseed * 3.That was true of the loader that walked
DT_NEEDEDitself. The loader now hands the work todlopen(), which returns the object already in the module registry rather than loading a second copy, so there is one library and one set of its globals, shared by every module that names it. The module's own data stays private per instance, becauseexec()loads the module afresh each time.What an instance can still assert on its own is that every add it made landed in the library, so that is what it checks. The test additionally checks the consequences: the library is pinned once rather than once per instance, and its destructor runs once, at the last close, holding what both instances built up.
The embedded module blobs are regenerated from the sources beside them.
depends-on: [apache/nuttx/pull/19673]
Testing
Run in full on QEMU
mps2-an500and on a Pimoroni Pico Plus 2 (RP2350), against apache/nuttx#19673.