|
|
|
@ -95,7 +95,7 @@ std::optional<recomp::symbol_table_t*> decomp_t::decompose(
|
|
|
|
|
decomp::routine_t rtn(sym, img, scn, fn, dcmp_type);
|
|
|
|
|
|
|
|
|
|
auto syms = rtn.decompose();
|
|
|
|
|
m_syms->add_symbols(syms);
|
|
|
|
|
m_syms->put_symbols(syms);
|
|
|
|
|
} else if (sym->storage_class == coff::storage_class_id::public_symbol ||
|
|
|
|
|
sym->storage_class == coff::storage_class_id::private_symbol) {
|
|
|
|
|
auto scn = img->get_section(sym->section_index - 1);
|
|
|
|
@ -140,7 +140,7 @@ std::optional<recomp::symbol_table_t*> decomp_t::decompose(
|
|
|
|
|
decomp::symbol_t new_scn_sym(img, scn_sym_name, 0, scn_data, scn, {},
|
|
|
|
|
relocs, sym_type_t::section);
|
|
|
|
|
|
|
|
|
|
m_syms->add_symbol(new_scn_sym);
|
|
|
|
|
m_syms->put_symbol(new_scn_sym);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// create a symbol for the data...
|
|
|
|
@ -149,7 +149,7 @@ std::optional<recomp::symbol_table_t*> decomp_t::decompose(
|
|
|
|
|
sym->value, {}, scn, sym, {},
|
|
|
|
|
sym_type_t::data);
|
|
|
|
|
|
|
|
|
|
m_syms->add_symbol(new_sym);
|
|
|
|
|
m_syms->put_symbol(new_sym);
|
|
|
|
|
}
|
|
|
|
|
} else if (sym->storage_class ==
|
|
|
|
|
coff::storage_class_id::
|
|
|
|
@ -162,7 +162,7 @@ std::optional<recomp::symbol_table_t*> decomp_t::decompose(
|
|
|
|
|
decomp::symbol_t bss_sym(img, symbol_t::name(img, sym).data(), {}, data,
|
|
|
|
|
{}, sym, {}, sym_type_t::data);
|
|
|
|
|
|
|
|
|
|
m_syms->add_symbol(bss_sym);
|
|
|
|
|
m_syms->put_symbol(bss_sym);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -189,8 +189,8 @@ std::uint32_t decomp_t::next_sym(coff::image_t* img,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::uint32_t decomp_t::ext_used_syms(const std::string&& entry_sym) {
|
|
|
|
|
std::optional<sym_data_t> entry;
|
|
|
|
|
if (!(entry = get_symbol(entry_sym.data())).has_value())
|
|
|
|
|
std::optional<sym_data_t> entry = get_symbol(entry_sym.data());
|
|
|
|
|
if (!entry.has_value())
|
|
|
|
|
return 0u;
|
|
|
|
|
|
|
|
|
|
std::set<coff::symbol_t*> cache;
|
|
|
|
@ -241,7 +241,11 @@ std::optional<sym_data_t> decomp_t::get_symbol(const std::string_view& name) {
|
|
|
|
|
if (sym->has_section())
|
|
|
|
|
return {{img, sym, size}};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (img && sym)
|
|
|
|
|
return {{img, sym, size}};
|
|
|
|
|
|
|
|
|
|
return {};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::vector<routine_t> decomp_t::rtns() {
|
|
|
|
|