Include R_MIPS_26 relocs in symbol file dumping/parsing

This commit is contained in:
Mr-Wiseguy 2025-01-23 01:33:24 -05:00
parent 5dce42d07e
commit bccc4990b4
2 changed files with 2 additions and 2 deletions

View file

@ -609,7 +609,7 @@ bool N64Recomp::Context::from_symbol_file(const std::filesystem::path& symbol_fi
RelocType reloc_type = reloc_type_from_name(type_string.value()); RelocType reloc_type = reloc_type_from_name(type_string.value());
if (reloc_type != RelocType::R_MIPS_HI16 && reloc_type != RelocType::R_MIPS_LO16 && reloc_type != RelocType::R_MIPS_32) { if (reloc_type != RelocType::R_MIPS_HI16 && reloc_type != RelocType::R_MIPS_LO16 && reloc_type != RelocType::R_MIPS_26 && reloc_type != RelocType::R_MIPS_32) {
throw toml::parse_error("Invalid reloc entry type", reloc_el.source()); throw toml::parse_error("Invalid reloc entry type", reloc_el.source());
} }

View file

@ -199,7 +199,7 @@ void dump_context(const N64Recomp::Context& context, const std::unordered_map<ui
for (const N64Recomp::Reloc& reloc : section.relocs) { for (const N64Recomp::Reloc& reloc : section.relocs) {
if (reloc.target_section == section_index || reloc.target_section == section.bss_section_index) { if (reloc.target_section == section_index || reloc.target_section == section.bss_section_index) {
// TODO allow emitting MIPS32 relocs for specific sections via a toml option for TLB mapping support. // TODO allow emitting MIPS32 relocs for specific sections via a toml option for TLB mapping support.
if (reloc.type == N64Recomp::RelocType::R_MIPS_HI16 || reloc.type == N64Recomp::RelocType::R_MIPS_LO16) { if (reloc.type == N64Recomp::RelocType::R_MIPS_HI16 || reloc.type == N64Recomp::RelocType::R_MIPS_LO16 || reloc.type == N64Recomp::RelocType::R_MIPS_26) {
fmt::print(func_context_file, " {{ type = \"{}\", vram = 0x{:08X}, target_vram = 0x{:08X} }},\n", fmt::print(func_context_file, " {{ type = \"{}\", vram = 0x{:08X}, target_vram = 0x{:08X} }},\n",
reloc_names[static_cast<int>(reloc.type)], reloc.address, reloc.target_section_offset + section.ram_addr); reloc_names[static_cast<int>(reloc.type)], reloc.address, reloc.target_section_offset + section.ram_addr);
} }