casaroli opened a new pull request, #19941: URL: https://github.com/apache/nuttx/pull/19941
## Summary The `ET_DYN` path computes run-time addresses from link-time ones in five places, each open-coding the arithmetic, and two of them disagree about how. `libelf_relocatedyn()` adds `textalloc` to a relocation's `r_offset` in one branch and subtracts `datasec` before adding `datastart` in the next, while the value translation a few lines down picks between those two forms with an explicit test on `datasec`. This collects that into `libelf_addr()`, which makes the test once: an address below the data segment's link-time base belongs to text, anything at or above it to data. It changes nothing today. `datastart - datasec` is `textalloc` for the way an object is placed now, so both forms reduce to the same arithmetic. They stop being the same once text and data are placed independently, which is what an FDPIC object requires, and having the translation in one function is what makes that possible without auditing every open-coded expression again. This is the fourth of four independent pieces split out of #19673, so each can be reviewed on its own. The others are `[1/4]`, `[2/4]` and `[3/4]`. They do not depend on each other and can merge in any order. ## Impact None intended. Pure refactor, no behaviour change, no configuration change. ## Testing Built for `mps3-an547:picostest`, which is `CONFIG_ELF` with `CONFIG_PIC`. `tools/checkpatch.sh` passes. Runtime evidence on real hardware follows tomorrow, on an RP2350. -- 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]
