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

Method dump

compute/host/elf_binary.cpp:386–412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

384 const symbol_t* symbol_ptr { nullptr };
385
386 void dump(ostream& sstr, const vector<section_t>& sections, const vector<symbol_t>& symbols) const {
387 sstr << "reloc: symbol ";
388 if (reloc_ptr->symbol_index < symbols.size()) {
389 sstr << symbols[reloc_ptr->symbol_index].name;
390 if (reloc_ptr->symbol_index == 0) {
391 sstr << "(NULL)";
392 }
393 } else {
394 sstr << "<invalid-symbol-idx>";
395 }
396 sstr << ", type: " << (underlying_type_t<ELF_RELOCATION_TYPE_X86_64>)reloc_ptr->type_x86_64;
397 sstr << ", add: " << reloc_ptr->addend;
398 bool found_section = false;
399 for (const auto& section : sections) {
400 if (reloc_ptr->offset >= section.header_ptr->offset &&
401 reloc_ptr->offset < (section.header_ptr->offset + section.header_ptr->size)) {
402 sstr << ", section: " << section.name;
403 found_section = true;
404 break;
405 }
406 }
407 if (!found_section) {
408 sstr << ", section: <unknown>";
409 }
410 sstr << ", offset: " << reloc_ptr->offset;
411 sstr << "\n";
412 }
413};
414
415struct elf_binary::elf_info_t {

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected