anjiahao1 opened a new pull request, #22259:
URL: https://github.com/apache/nuttx/pull/22259
## Summary
Add tools/symbolshare.py, a helper for protected builds that shares
symbols from specified sections of the kernel ELF with the user ELF.
The tool extracts the symbols from the requested sections, checks
whether they are already defined in the user link library, and writes
a linker script that assigns the shared symbol addresses.
Usage:
```
symbolshare.py -e kernel.elf -s section1 [section2] -a user.linklib
```
## Impact
* Is new feature added? YES - a host-side helper tool.
* 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, Python 3, lief 0.16.5
* `python3 -m py_compile tools/symbolshare.py`
* `python3 tools/symbolshare.py --help`
* Happy path: a demo object with a `.data` symbol and an unrelated
library produced `shared_var = 0x0;` in the generated linker script.
* Duplicate check: symbols from a built sim `.data` section that are
also defined in `libc.a` were reported and the tool exited non-zero.
## 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]