nuttx/libs/libc
Marco Casaroli ec78241ebe libs/libc/elf: Load an FDPIC object's data into the data heap.
An architecture that sets CONFIG_ARCH_USE_DATA_HEAP gives a loaded module
its data from up_dataheap_memalign(), because the ordinary heap is not where
that data belongs there.  The ELF loader honours it for every object but an
FDPIC one: an FDPIC object places its writable segment on its own, and that
allocation, and the two places that free it, still use lib_memalign() and
lib_free().  Its text already comes from the text heap.

So an FDPIC module's data goes to the data heap too, and back to it when the
module is unloaded or removed.

On mps3-an547, which sets both heaps, fdpicxip loaded the data of its two
instances at 0x1007220 and 0x104e480, in the ordinary heap.  With this change
they are at 0x21000000 and 0x21000180, in the SRAM2 data heap, and both
instances run.  In a protected build the difference matters: there the
ordinary heap is kernel memory, and the module takes a data access violation
on its first access to its data.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-09-30 13:39:45 -03:00
..
aio libc/aio: loop in aio_suspend() until a listed request completes 2026-09-14 17:12:49 -03:00
assert lib_stackchk.c: a duplicate implementation error reported during compilation 2026-02-02 13:22:07 +08:00
audio include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
builtin libc/builtin: support per-application priority/stacksize under KERNEL build. 2026-07-13 15:23:39 -03:00
ctype
dirent libs/libc/dirent: Add a blank line after a declaration. 2026-09-25 10:46:48 -03:00
dlfcn libc/dlfcn: Count opens so a library can be shared. 2026-08-04 11:12:49 -03:00
elf libs/libc/elf: Load an FDPIC object's data into the data heap. 2026-09-30 13:39:45 -03:00
errno
eventfd
fdt cmake: Use NUTTX(_DIR/_BIN_DIR) instead CMAKE(_SRC_DIR/_BIN_DIR) 2026-08-09 11:13:08 -03:00
fixedmath !compiler: drop CONFIG_HAVE_LONG_LONG and require long long support 2026-05-19 16:21:28 +08:00
gdbstub arch/arm64: fix backtrace register access and gdbstub config guard 2026-01-16 08:55:47 -03:00
gnssutils cmake: Use NUTTX(_DIR/_BIN_DIR) instead CMAKE(_SRC_DIR/_BIN_DIR) 2026-08-09 11:13:08 -03:00
grp libs/libc/grp: fix getgrbuf_r() pointer-alignment padding 2026-08-14 10:20:52 +08:00
hex2bin include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
inttypes !compiler: drop CONFIG_HAVE_LONG_LONG and require long long support 2026-05-19 16:21:28 +08:00
libgen
locale
lzf !compiler: drop CONFIG_HAVE_LONG_LONG and require long long support 2026-05-19 16:21:28 +08:00
machine libs/libc/machine/arm: Relocate FDPIC function descriptors. 2026-09-13 16:03:32 -03:00
misc libs/libc: Define the NXFLAT ABI marker in libc. 2026-09-28 16:45:48 -03:00
net include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
netdb libs/libc/netdb: Size an answer header by its header, not by its union. 2026-08-08 15:02:15 -03:00
obstack include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
pthread libc, sched: Resolve FDPIC descriptors at module callback entry points. 2026-09-25 10:46:48 -03:00
pwd sched: add supplementary group IDs (setgroups/getgroups/initgroups) 2026-08-12 16:06:03 -03:00
queue
regex libs/libc/regex: remove logically dead code in regcomp.c 2026-01-24 19:28:56 +08:00
sched include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
search
semaphore sched/semaphore: Correct the return value comment of nxsem_init/nxmutex_init 2026-09-25 10:37:43 +02:00
signal sched/signal: Add support for disabling all signal functions 2026-01-18 08:24:13 -03:00
spawn spawn: allow zero stacksize/priority to use binary loader defaults 2026-07-15 12:24:44 -03:00
stdio libc/stdio: allocate a buffer in getdelim() when *lineptr is NULL 2026-09-23 12:52:09 +08:00
stdlib libc, sched: Resolve FDPIC descriptors at module callback entry points. 2026-09-25 10:46:48 -03:00
stream libc/stream: Check lowout bounds before access 2026-07-06 09:02:22 +02:00
string libs/libc/string: Copy and compare by words when pointers agree on alignment. 2026-08-24 12:02:02 +08:00
symtab libs/libc/symtab: fix bogus symbol size under SYMTAB_ORDEREDBYNAME 2026-08-05 21:51:25 +08:00
syslog
termios drivers/serial: add job-control TTY ioctls and libc wrappers 2026-06-23 16:26:53 -03:00
time libc/time: Fix POSIX timezone string parsing. 2026-07-25 19:54:18 +08:00
tls libc/tls: update preprocessor condition comment to match implementation 2026-01-31 02:49:10 +08:00
uio
unistd fs/aio: add configurable AIO_LISTIO_MAX limit 2026-09-14 17:12:49 -03:00
userfs include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
uuid
wchar
wctype
wqueue libc/wqueue: use the uninterruptible wait helper 2026-09-04 23:02:48 +08:00
zoneinfo tools: fix stale archive members surviving a Kconfig-driven CSRCS change 2026-07-28 21:26:03 -03:00
.gitignore
CMakeLists.txt
Kconfig
libc.csv sched/pthread: Implement pthread_sigqueue 2026-09-21 14:53:26 +08:00
libc.h libs/libc/string: Copy and compare by words when pointers agree on alignment. 2026-08-24 12:02:02 +08:00
limits_check.c libs/libc: add limits checks 2026-07-02 09:02:21 -03:00
Makefile tools: fix stale archive members surviving a Kconfig-driven CSRCS change 2026-07-28 21:26:03 -03:00