nuttx/binfmt/libnxflat
Marco Casaroli 08c0cce0d9 libs/libc: Define the NXFLAT ABI marker in libc.
Every NXFLAT module imports __nxflat_abi_v2, and the loader resolves it
against the symbol table exec() is given, like any other import.  It was
defined in binfmt/libnxflat, which is enough for a flat build, where the
firmware and the applications are one image.

In a protected build the table comes from the application, in the user
image, which cannot see a kernel symbol: the user image fails to link with
an undefined reference to __nxflat_abi_v2 as soon as an application
generates its table from the modules' imports, as examples/nxflat does.  A
kernel build is the same, with one image per process.

libc is linked into each of those images, so the marker is defined there
now.  Nothing else changes: its value is still never used.

On mps3-an547:knsh under QEMU with CONFIG_NXFLAT and examples/nxflat, the
user image links, and errno, hello, mutex, pthread and struct run.
lm3s6965-ek:qemu-nxflat still runs every module to the end.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-09-28 16:45:48 -03:00
..
CMakeLists.txt
gnu-nxflat-gotoff.ld
gnu-nxflat-pcrel.ld
Kconfig
libnxflat.h
libnxflat_addrenv.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
libnxflat_bind.c libs/libc: Define the NXFLAT ABI marker in libc. 2026-09-28 16:45:48 -03:00
libnxflat_init.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
libnxflat_load.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
libnxflat_read.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
libnxflat_uninit.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
libnxflat_unload.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
libnxflat_verify.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
Make.defs