nuttx/libs/libc
Marco Casaroli 1a18646375 libs/libc/elf: Lay out the PLT of an FDPIC module as the linker expects.
gnu-elf.ld.in named neither .rel.plt nor .got.plt, and the linker placed
them where its FDPIC code does not expect them.

It merged .rel.plt into .rel.dyn but still set DT_JMPREL as if .rel.plt
came last, so the loader bound each PLT slot with the symbol of another
relocation.  And .got.plt came after .got: the offsets that the linker
gave the local function descriptors did not match where it put them, and
the first call through one jumped into data.

A module without a PLT has neither section, so neither problem showed
until a module called its imports through a PLT.

Give .rel.dyn and .rel.plt output sections of their own, and put .got.plt
first in .got, both as in the linker's own script.  Only CONFIG_FDPIC
changes.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-10-07 11:45:09 -03:00
..
aio libc/aio: loop in aio_suspend() until a listed request completes 2026-09-14 17:12:49 -03:00
assert
audio
builtin
ctype
dirent libs/libc/dirent: Add a blank line after a declaration. 2026-09-25 10:46:48 -03:00
dlfcn
elf libs/libc/elf: Lay out the PLT of an FDPIC module as the linker expects. 2026-10-07 11:45:09 -03:00
errno
eventfd
fdt
fixedmath
gdbstub
gnssutils
grp
hex2bin
inttypes
libgen
locale
lzf
machine libs/libc/elf: Load the libraries a module names in DT_NEEDED. 2026-10-06 17:48:49 -03:00
misc libs/libc: Define the NXFLAT ABI marker in libc. 2026-09-28 16:45:48 -03:00
net
netdb
obstack
pthread libc, sched: Resolve FDPIC descriptors at module callback entry points. 2026-09-25 10:46:48 -03:00
pwd
queue
regex
sched
search
semaphore sched/semaphore: Correct the return value comment of nxsem_init/nxmutex_init 2026-09-25 10:37:43 +02:00
signal signal: Inline nxsig_addset(), nxsig_delset() and nxsig_ismember(). 2026-10-06 17:45:52 -03:00
spawn
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
string libs/libc/string: Copy and compare by words when pointers agree on alignment. 2026-08-24 12:02:02 +08:00
symtab
syslog
termios libc/termios: Fix the ttyname_r buffer overflow with long tty paths. 2026-10-05 18:42:52 +08:00
time
tls
uio
unistd fs/aio: add configurable AIO_LISTIO_MAX limit 2026-09-14 17:12:49 -03:00
userfs
uuid
wchar
wctype
wqueue libc/wqueue: use the uninterruptible wait helper 2026-09-04 23:02:48 +08:00
zoneinfo
.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
Makefile