nuttx/tools
Marco Casaroli 295f0e373c tools/nxflat: Leave ARM unwind tables out of an NXFLAT module.
CONFIG_UNWINDER_ARM compiles everything with -funwind-tables, modules
included, so each module carries .ARM.exidx and .ARM.extab.  The NXFLAT
link scripts do not name them, and ldnxflat placed them in D-Space, where
the first R_ARM_PREL31 entry stopped the conversion:

  ldnxflat: arm relocation 42 at D-Space 00000018 is not handled

That relocation cannot be handled: an exidx entry is an offset from itself
to a function in I-Space, and the distance between the two segments is only
known when the loader places them.  Nothing unwinds through a module
either, since the unwinder only reads the firmware's own table.

So ldnxflat leaves both sections out of the images, and with them the
relocations against them, as it already does for sections it does not
place.  A module without unwind tables converts exactly as before.

On mps3-an547:nsh under QEMU with CONFIG_UNWINDER_ARM and examples/nxflat,
the modules failed to convert; now they convert and errno, hello, mutex,
pthread and struct run.  The eleven modules of tools/nxflat/testsuite.sh
convert to the same bytes as before.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-09-28 16:45:09 -03:00
..
ameba
bcm2711
bl602
ci
codeowners
cxd56
esp32
esp32c3
esp32s2
esp32s3
espressif
imx9
imxrt1180
licensing
lwl
mpfs
nix
nxflat tools/nxflat: Leave ARM unwind tables out of an NXFLAT module. 2026-09-28 16:45:09 -03:00
pic32
pynuttx
rp23xx
rp2040
simwifi
zds
.gitignore
aarch64-unknown-nuttx-macho.json
aarch64-unknown-nuttx.json
abi_check.py
b16.c
bdf-converter.c
board_romfs_mkpasswd.sh
btdecode.sh
build-globals.sh
callstack.py
cfgdefine.c
cfgdefine.h
cfgparser.c
cfgparser.h
check_passwd_keys.sh
checkkconfig.py
checkpatch.sh
checkrelease.sh
CMakeLists.txt
cmpconfig.c
cnvwindeps.c
Config.mk
configure.bat
configure.c
configure.sh
configure_completion.bash
convert-comments.c
copydir.bat
copydir.sh
coredump.py
csvparser.c
csvparser.h
D.defs
define.bat
define.sh
detab.c
Directories.mk
discover.py
doreleasenotes.py
Export.mk
find_symbol_callers.sh
flash_writer.py
FlatLibs.mk
gcov.py
gdbserver.py
gen_passwd_keys.sh
gencromfs.c
host_info_dump.py
host_info_parse.py
i486-unknown-nuttx.json
ide_exporter.py
incdir.bat
incdir.c
incdir.sh
indent.sh
initialconfig.c
jlink-nuttx.c
kasan_global.py
kconfig.bat
kconfig2html.c
KernelLibs.mk
LibTargets.mk
link.bat
link.sh
lowhex.c
macar-qcs.sh
Make.defs
Makefile.host
merge_config.py
mkallsyms.py
mkallsyms.sh
mkconfig.c
mkconfigvars.sh
mkctags.sh
mkdeps.c
mkexport.sh
mkfsdata.pl
mkfsdata.py
mknulldeps.sh
mkpasswd.c
mkromfsimg.sh
mksymtab.c
mksyscall.c
mkversion.c
mkwindeps.sh
netusb.sh
noteinfo.c
nxstyle.c
nxstyle_sweep.sh
nxtagspkgsfetch.sh
parsecallstack.py
parsememdump.py
parsetrace.py
passwd_keys.mk
pre-commit
process_config.py
process_config.sh
promptpasswd.sh
ProtectedLibs.mk
refresh.sh
rmcr.c
Rust.defs
sethost.sh
showsize.sh
simbridge.sh
simhostroute.sh
simlaunch.sh
size_report.py
splashscreen_converter.py
stackusage.py
stm32_pinmap_tool.py
Swift.defs
testbuild.ps1
testbuild.sh
toolchain.cmake.export
uncrustify.cfg
Unix.mk
unlink.bat
unlink.sh
update_romfs_password.sh
version.sh
Win.mk
x86_64-unknown-nuttx-macho.json
x86_64-unknown-nuttx.json
xmlrpc_test.py
Zig.defs
zipme.sh