Support alternative symbol resolving implementations for elf_loader (AEGHB-1243)#588
Support alternative symbol resolving implementations for elf_loader (AEGHB-1243)#588KenVanHoeylandt wants to merge 4 commits intoespressif:masterfrom
Conversation
👋 Hello KenVanHoeylandt, we appreciate your contribution to this project! Click to see more instructions ...
Review and merge process you can expect ...
|
a304bcb to
b51121b
Compare
|
Any feedback on this? |
Hi @KenVanHoeylandt you can use the script to automatically add symbols for unlinked functions or variables from the required ELF application, this way, the functions and variables you need to look up will be automatically added to |
|
@cwespressif Thanks for the suggestion and my apologies for the slow response. The usage example won't work if someone uses the dependency from the component registry.
That's why I propose to make the symbol resolving dynamic. The script does work well, but it's not usable in my scenario: my application has 16500 symbols. Some of the application libraries have symbols that I can include fully, but some libraries only have a select amount of symbols that I want to export. Part of it works a bit like the linux kernel, where kernel modules define which functions they export. I have about a dozen different lists of functions I need to export (e.g. C stdlib, C++ new/del/stl, LVGL, HAL/drivers, etc.) and having control the symbol resolving could easily facilitate that. |
|
Hi @KenVanHoeylandt thank you for submitting the PR, the implementation of this feature looks good. |
|
@cwespressif Thanks for responding! Those functions solve a part of my problem. My use case (currently and future plans) has evolved a little bit, so I'll explain below why it's not sufficient for me. I want to have my own platform-independent definition of symbols inside my project. Practically speaking, I have kernel modules that might export these symbols: struct Module {
const char* name;
error_t (*start)(void);
error_t (*stop)(void);
const struct ModuleSymbols* symbols;
};Example modules: LVGL, or a module that contains drivers. 2. Limiting exposure of symbols My external ELF have a manifest file (
Conclusion Implementing a custom "find symbol" function is the simplest solution to go forward for my use cases, as it gives me full control on how to map functions and which ones to map for which app. |
|
@KenVanHoeylandt Please resolve the branch conflicts, modify the component version and the specific changes. |
|
I fixed the conflicts and tested again on:
I've also updated the component version and the changelog. Before this update, the code was tested on 20+ devices. |
|
@cwespressif ping/reminder 😅 |

Description
Allow override of the symbol mapping functionality. See proposal for details.
I also included a small fix for C++ compilers that error out here:
The solution was to cast explicitly:
Related
Testing
Tested on LilyGo T-Deck Plus with ESP-IDF 5.5 installed on Linux with Intel 64-bit.
Checklist
Before submitting a Pull Request, please ensure the following: