anjiahao1 opened a new pull request, #22413: URL: https://github.com/apache/nuttx/pull/22413
## Summary Drop the negative r_offset check in modlib_relocateadd(). Elf_Rel.r_offset is an address type (Elf32_Addr / Elf64_Addr) and can never be negative, so r_offset < 0 is dead code. It also raises a -Wtype-limits warning when the comparison is analysed. Keep only the upper bound check against the destination section size. ## Impact * Is new feature added? NO - dead code removal. * Impact on user: NO * Impact on build: NO * Impact on hardware: NO * Impact on documentation: NO * Impact on security: NO * Impact on compatibility: NO ## Testing Build host: Linux x86_64, gcc 13.3. ``` tools/configure.sh -a <apps> sim:module make -j10 ``` The build completes with the changed file compiled in. ## PR verification * [x] This PR introduces only one functional change. * [x] I have updated all required description fields above. * [x] My PR adheres to Contributing Guidelines and Documentation. * [ ] My PR is still work in progress (not ready for review). * [x] My PR is ready for review and can be safely merged into a codebase. -- 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]
