mirror of
https://github.com/N64Recomp/N64Recomp.git
synced 2025-06-29 05:26:17 +00:00
Merge 91be352ee0
into 989a86b369
This commit is contained in:
commit
1861b225bb
2 changed files with 16 additions and 1 deletions
|
@ -663,7 +663,15 @@ bool N64Recomp::Context::import_reference_context(const N64Recomp::Context& refe
|
|||
|
||||
// Copy the functions from the reference context into the reference context's function map.
|
||||
for (const N64Recomp::Function& func_in: reference_context.functions) {
|
||||
if (!add_reference_symbol(func_in.name, func_in.section_index, func_in.vram, true)) {
|
||||
// Rename if necessary
|
||||
std::string name = func_in.name;
|
||||
if (N64Recomp::reimplemented_funcs.contains(name) ||
|
||||
N64Recomp::ignored_funcs.contains(name) ||
|
||||
N64Recomp::renamed_funcs.contains(name)) {
|
||||
name = name + "_recomp";
|
||||
}
|
||||
|
||||
if (!add_reference_symbol(name, func_in.section_index, func_in.vram, true)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -416,6 +416,13 @@ ELFIO::section* read_sections(N64Recomp::Context& context, const N64Recomp::ElfP
|
|||
|
||||
// Check if the symbol is undefined and to know whether to look for it in the reference symbols.
|
||||
if (rel_symbol_section_index == ELFIO::SHN_UNDEF) {
|
||||
// Get renamed version of symbol name if necessary
|
||||
if (N64Recomp::reimplemented_funcs.contains(rel_symbol_name) ||
|
||||
N64Recomp::ignored_funcs.contains(rel_symbol_name) ||
|
||||
N64Recomp::renamed_funcs.contains(rel_symbol_name)) {
|
||||
rel_symbol_name = rel_symbol_name + "_recomp";
|
||||
}
|
||||
|
||||
// Undefined sym, check the reference symbols.
|
||||
N64Recomp::SymbolReference sym_ref;
|
||||
if (!context.find_reference_symbol(rel_symbol_name, sym_ref)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue