PPC: Fix pooled relocation addends being added twice sometimes (#184)

This commit is contained in:
LagoLunatic 2025-03-31 00:00:36 -04:00 committed by GitHub
parent e101610416
commit b9ba5796ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -513,6 +513,7 @@ fn guess_data_type_from_load_store_inst_op(inst_op: ppc750cl::Opcode) -> Option<
}
}
#[derive(Debug)]
struct PoolReference {
addr_src_gpr: ppc750cl::GPR,
addr_offset: i16,
@ -645,7 +646,7 @@ fn make_fake_pool_reloc(
// example, dCcD_Cyl in The Wind Waker). So just showing that vtable symbol plus an addend
// to represent the offset into it works fine in this case.
target_symbol = pool_reloc.relocation.target_symbol;
addend = pool_reloc.relocation.addend + offset_from_pool;
addend = offset_from_pool;
}
Some(Relocation {
flags: RelocationFlags::Elf(elf::R_PPC_NONE),