| 1263 | } |
| 1264 | |
| 1265 | const void* elf_binary::resolve_section(internal_instance_t& instance, const symbol_t& sym) { |
| 1266 | if (sym.symbol_ptr->section_header_table_index >= info->sections.size()) { |
| 1267 | log_error("section index is out-of-bounds: $", sym.symbol_ptr->section_header_table_index); |
| 1268 | return nullptr; |
| 1269 | } |
| 1270 | const auto& sec = info->sections[sym.symbol_ptr->section_header_table_index]; |
| 1271 | const auto sec_iter = instance.section_map.find(&sec); |
| 1272 | if (sec_iter == instance.section_map.end()) { |
| 1273 | log_error("failed to find section: $", sym.symbol_ptr->section_header_table_index); |
| 1274 | return nullptr; |
| 1275 | } |
| 1276 | return sec_iter->second; |
| 1277 | } |
| 1278 | |
| 1279 | const void* elf_binary::resolve(internal_instance_t& instance, instance_t& ext_instance, const relocation_t& relocation) { |
| 1280 | const void* resolved_ptr = nullptr; |