nuttx-apps/testing/fs/xipfs
Marco Casaroli 6e61ce7cb7 examples/fdpicxip, testing/fs/xipfs: A DT_NEEDED library is one instance.
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>
2026-08-07 11:24:32 +08:00
..
callback_bin.h testing/fs/xipfs: Cover the FDPIC module loader. 2026-07-31 18:47:17 -03:00
CMakeLists.txt testing/fs/xipfs: Add a test suite for the xipfs file system. 2026-07-28 16:47:49 +08:00
counteruser_bin.h examples/fdpicxip, testing/fs/xipfs: A DT_NEEDED library is one instance. 2026-08-07 11:24:32 +08:00
cxxuser_bin.h examples/fdpicxip, testing/fs/xipfs: A DT_NEEDED library is one instance. 2026-08-07 11:24:32 +08:00
funcdesc_bin.h testing/fs/xipfs: Cover the FDPIC module loader. 2026-07-31 18:47:17 -03:00
Kconfig testing/fs/xipfs: Cover the FDPIC module loader. 2026-07-31 18:47:17 -03:00
lazymod_bin.h testing/fs/xipfs: Cover the FDPIC module loader. 2026-07-31 18:47:17 -03:00
libcounter_bin.h testing/fs/xipfs: Cover the FDPIC module loader. 2026-07-31 18:47:17 -03:00
libshape_bin.h testing/fs/xipfs: Cover the FDPIC module loader. 2026-07-31 18:47:17 -03:00
Make.defs testing/fs/xipfs: Add a test suite for the xipfs file system. 2026-07-28 16:47:49 +08:00
Makefile testing/fs/xipfs: Add a test suite for the xipfs file system. 2026-07-28 16:47:49 +08:00
manyneeded_bin.h testing/fs/xipfs: Cover the FDPIC module loader. 2026-07-31 18:47:17 -03:00
missingsym_bin.h testing/fs/xipfs: Cover the FDPIC module loader. 2026-07-31 18:47:17 -03:00
xipfs_main.c examples/fdpicxip, testing/fs/xipfs: A DT_NEEDED library is one instance. 2026-08-07 11:24:32 +08:00