MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / esp_elf_map_sym

Function esp_elf_map_sym

Libraries/elf_loader/src/esp_elf.c:344–354  ·  view source on GitHub ↗

* @brief Map symbol's address of ELF to physic space. * * @param elf - ELF object pointer * @param sym - ELF symbol address * * @return ESP_OK if success or other if failed. */

Source from the content-addressed store, hash-verified

342 * @return ESP_OK if success or other if failed.
343 */
344uintptr_t esp_elf_map_sym(esp_elf_t *elf, uintptr_t sym)
345{
346 for (int i = 0; i < ELF_SECS; i++) {
347 if ((sym >= elf->sec[i].v_addr) &&
348 (sym < (elf->sec[i].v_addr + elf->sec[i].size))) {
349 return sym - elf->sec[i].v_addr + elf->sec[i].addr;
350 }
351 }
352
353 return 0;
354}
355
356/**
357 * @brief Initialize ELF object.

Callers 2

esp_elf_relocateFunction · 0.85
esp_elf_arch_relocateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected