nuttx/libs/libc/elf
Marco Casaroli bf3a5b0b35 libs/libc/elf: Link a kernel-build program the way the loader loads it.
The loader packs the allocatable sections of a fully linked program into the
text and data regions in section header order, and on a chip that selects
ARCH_HAVE_TEXT_HEAP_WORD_ALIGNED_READ every section that is not executable
goes to the data region.  The template left .rodata in the text region, so
the addresses the program carries did not say where it would be loaded.

.rodata now leads the data region on such a chip, .eh_frame is placed rather
than left an orphan, and the Xtensa literal pools are gathered with the text
they belong to:  a literal section is not executable, so an orphan one would
be loaded into the data region, away from the code that reads it.

The ESP32-S3 needs all three.  With them the shared template lays out a user
program exactly as the board script it replaces did, section for section.

Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-09-26 11:13:57 -03:00
..
CMakeLists.txt cmake: Use NUTTX(_DIR/_BIN_DIR) instead CMAKE(_SRC_DIR/_BIN_DIR) 2026-08-09 11:13:08 -03:00
elf.h libs/libc/elf: Place an FDPIC object's segments independently. 2026-09-08 16:31:16 -03:00
elf_addrenv.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
elf_bind.c binfmt/elf: Load FDPIC modules through the ELF loader. 2026-09-26 11:13:30 -03:00
elf_depend.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
elf_gethandle.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
elf_getsymbol.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
elf_globals.S
elf_init.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
elf_insert.c binfmt/elf: Load FDPIC modules through the ELF loader. 2026-09-26 11:13:30 -03:00
elf_iobuffer.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
elf_load.c libs/libc/elf, binfmt: Describe the GOT by base and size, not by index. 2026-09-08 16:31:16 -03:00
elf_loadhdrs.c libs/libc/elf: Place an FDPIC object's segments independently. 2026-09-08 16:31:16 -03:00
elf_read.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
elf_registry.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
elf_remove.c binfmt/elf: Load FDPIC modules through the ELF loader. 2026-09-26 11:13:30 -03:00
elf_sections.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
elf_symbols.c libs/libc/elf, binfmt: Describe the GOT by base and size, not by index. 2026-09-08 16:31:16 -03:00
elf_symtab.c
elf_uninit.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
elf_unload.c libs/libc/elf: Place an FDPIC object's segments independently. 2026-09-08 16:31:16 -03:00
elf_verify.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
gnu-elf.ld.in libs/libc/elf: Link a kernel-build program the way the loader loads it. 2026-09-26 11:13:57 -03:00
Kconfig
Make.defs
Makefile