mirror of https://github.com/encounter/objdiff.git
Clear pool relocs in volatile registers on function call
This fixes some false positives.
This commit is contained in:
parent
9051f48731
commit
507b988aa3
|
@ -520,6 +520,16 @@ fn generate_fake_pool_reloc_for_addr_mapping(
|
|||
) => {
|
||||
active_pool_relocs.insert(addr_dst_gpr.0, reloc.clone()); // `lis` + `ori`
|
||||
}
|
||||
(Opcode::B, _, _, _) => {
|
||||
if simplified.mnemonic == "bl" {
|
||||
// When encountering a function call, clear any active pool relocations from
|
||||
// the volatile registers (r0, r3-r12), but not the nonvolatile registers.
|
||||
active_pool_relocs.remove(&0);
|
||||
for gpr in 3..12 {
|
||||
active_pool_relocs.remove(&gpr);
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
} else if let Some((offset, addr_src_gpr, addr_dst_gpr)) =
|
||||
|
|
Loading…
Reference in New Issue