mirror of
https://github.com/apache/nuttx.git
synced 2026-09-09 18:36:37 +00:00
The commits that follow teach the ELF loader to load an FDPIC object. This puts the option they hang off and the definitions they share in one place first, so each of them builds on its own. CONFIG_FDPIC depends on ARCH_HAVE_ELF_FDPIC, which an architecture selects when it has a PIC base register and the FDPIC relocations. Only armv7-m and armv8-m select it today, and it defaults off, so nothing changes for anyone who does not ask for it. include/nuttx/fdpic.h holds what both sides of the loader need: the two word function descriptor an FDPIC module passes instead of a code address, the test for whether the caller is such a module, and the call sequence that enters one with its own data base. All of it is behind CONFIG_FDPIC, thus the header is empty without it and a file may include it unconditionally. The call sequence itself is architecture specific, so arch/arm/include/arch.h supplies it as up_fdpic_invoke(), beside the other PIC base register macros. up_setpicbase() cannot serve here: the register has to hold the module's base for exactly one call and then go back, and nothing in C tells the compiler the register is live across that call, so the save, the install, the branch and the restore have to be one sequence. Built for mps3-an547:bl and mps3-an547:picostest, with CONFIG_FDPIC off, which is every configuration in the tree. Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com> |
||
|---|---|---|
| .. | ||
| libnxflat | ||
| binfmt.h | ||
| binfmt_checkexec.c | ||
| binfmt_copyactions.c | ||
| binfmt_copyargv.c | ||
| binfmt_dumpmodule.c | ||
| binfmt_exec.c | ||
| binfmt_execmodule.c | ||
| binfmt_execsymtab.c | ||
| binfmt_exit.c | ||
| binfmt_globals.c | ||
| binfmt_initialize.c | ||
| binfmt_loadmodule.c | ||
| binfmt_register.c | ||
| binfmt_unloadmodule.c | ||
| binfmt_unregister.c | ||
| builtin.c | ||
| CMakeLists.txt | ||
| elf.c | ||
| Kconfig | ||
| Makefile | ||
| nxflat.c | ||