casaroli opened a new pull request, #20385: URL: https://github.com/apache/nuttx/pull/20385
## Summary `CONFIG_UNWINDER_ARM` compiles everything with `-funwind-tables`, NXFLAT modules included, so each module carries `.ARM.exidx` and `.ARM.extab`. The NXFLAT link scripts do not name them, `ldnxflat` placed them in D-Space, and the first `R_ARM_PREL31` 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 known only when the loader places them. Nothing unwinds through a module either, because the unwinder reads only 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 any section it does not place. ## Impact Only NXFLAT modules that carry unwind tables change, and they now convert. A module without them converts to the same bytes as before. `mps3-an547:knsh` is an in-tree configuration that sets `CONFIG_UNWINDER_ARM`. ## Testing `mps3-an547:nsh` under QEMU with `CONFIG_UNWINDER_ARM` and `examples/nxflat`: with the current tool the modules fail to convert with the error above; with this change they convert, and errno, hello, mutex, pthread and struct run. (`signal` and `task` fail the same way with the unwinder off, so that is a separate problem.) The eleven modules of `tools/nxflat/testsuite.sh`, which have no unwind tables, convert to the same bytes with the old and new tool. `tools/checkpatch.sh -c -u -m -g` passes. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
