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

Function esp_elf_print_shdr

Libraries/elf_loader/src/esp_elf.c:638–656  ·  view source on GitHub ↗

* @brief Print section header description information of ELF. * * @param pbuf - ELF data buffer * * @return None */

Source from the content-addressed store, hash-verified

636 * @return None
637 */
638void esp_elf_print_shdr(const uint8_t *pbuf)
639{
640 const elf32_hdr_t *ehdr = (const elf32_hdr_t *)pbuf;
641 const elf32_shdr_t *shdr = (const elf32_shdr_t *)((size_t)pbuf + ehdr->shoff);
642
643 for (int i = 0; i < ehdr->shnum; i++) {
644 ESP_LOGI(TAG, "%-40s %d", "name:", shdr->name);
645 ESP_LOGI(TAG, "%-40s %d", "type:", shdr->type);
646 ESP_LOGI(TAG, "%-40s 0x%x", "flags:", shdr->flags);
647 ESP_LOGI(TAG, "%-40s %x", "addr", shdr->addr);
648 ESP_LOGI(TAG, "%-40s %x", "offset:", shdr->offset);
649 ESP_LOGI(TAG, "%-40s %d", "size", shdr->size);
650 ESP_LOGI(TAG, "%-40s 0x%x", "link", shdr->link);
651 ESP_LOGI(TAG, "%-40s %d", "addralign", shdr->addralign);
652 ESP_LOGI(TAG, "%-40s %d", "entsize", shdr->entsize);
653
654 shdr = (const elf32_shdr_t *)((size_t)shdr + sizeof(elf32_shdr_t));
655 }
656}
657
658/**
659 * @brief Print section information of ELF.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected