MCPcopy Create free account
hub / github.com/a2flo/floor / resolve_section

Method resolve_section

src/device/host/elf_binary.cpp:1265–1277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1263}
1264
1265const 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
1279const void* elf_binary::resolve(internal_instance_t& instance, instance_t& ext_instance, const relocation_t& relocation) {
1280 const void* resolved_ptr = nullptr;

Callers

nothing calls this directly

Calls 3

findMethod · 0.80
sizeMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected