Skip to content

Commit b9ba579

Browse files
authoredMar 31, 2025··
PPC: Fix pooled relocation addends being added twice sometimes (#184)
1 parent e101610 commit b9ba579

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎objdiff-core/src/arch/ppc.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ fn guess_data_type_from_load_store_inst_op(inst_op: ppc750cl::Opcode) -> Option<
513513
}
514514
}
515515

516+
#[derive(Debug)]
516517
struct PoolReference {
517518
addr_src_gpr: ppc750cl::GPR,
518519
addr_offset: i16,
@@ -645,7 +646,7 @@ fn make_fake_pool_reloc(
645646
// example, dCcD_Cyl in The Wind Waker). So just showing that vtable symbol plus an addend
646647
// to represent the offset into it works fine in this case.
647648
target_symbol = pool_reloc.relocation.target_symbol;
648-
addend = pool_reloc.relocation.addend + offset_from_pool;
649+
addend = offset_from_pool;
649650
}
650651
Some(Relocation {
651652
flags: RelocationFlags::Elf(elf::R_PPC_NONE),

0 commit comments

Comments
 (0)
Please sign in to comment.