* @brief Load the ELF interpreter into memory. * * @param load_info Pointer to the ELF loading context. * @param interp_base Pointer to store the interpreter's base address. * * @return RT_EOK on success, -RT_ERROR on failure. */
| 709 | * @return RT_EOK on success, -RT_ERROR on failure. |
| 710 | */ |
| 711 | static int load_elf_interp(elf_load_info_t *load_info, rt_ubase_t *interp_base) |
| 712 | { |
| 713 | int ret; |
| 714 | rt_ubase_t load_base = ELF_INTERP_LOAD_ADDR + elf_random_offset(); |
| 715 | |
| 716 | ret = total_mapping_size(&load_info->interp_info); |
| 717 | if (ret) |
| 718 | { |
| 719 | LOG_E("%s : total_mapping_size failed", __func__); |
| 720 | return -RT_ERROR; |
| 721 | } |
| 722 | LOG_D("%s : total_mapping_size 0x%x", __func__, load_info->interp_info.map_size); |
| 723 | |
| 724 | return elf_file_mmap(load_info, &load_info->interp_info, interp_base, |
| 725 | load_info->interp_info.map_size, &load_base); |
| 726 | } |
| 727 | |
| 728 | /** |
| 729 | * @brief Populate the auxiliary vector for an ELF-loaded process. |
no test coverage detected