* @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. */
| 342 | * @return ESP_OK if success or other if failed. |
| 343 | */ |
| 344 | uintptr_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. |
no outgoing calls
no test coverage detected