mirror of
https://github.com/encounter/objdiff.git
synced 2025-12-12 22:56:19 +00:00
PPC: Detect unpooled string literal references (#188)
* Update openssl and tokio for Cargo deny * PPC: Detect unpooled string literal references
This commit is contained in:
@@ -330,6 +330,7 @@ fn reloc_eq(
|
||||
|| address_eq(left_reloc, right_reloc))
|
||||
&& (diff_config.function_reloc_diffs == FunctionRelocDiffs::NameAddress
|
||||
|| left_reloc.symbol.kind != SymbolKind::Object
|
||||
|| right_reloc.symbol.size == 0 // Likely a pool symbol like ...data, don't treat this as a diff
|
||||
|| display_ins_data_literals(left_obj, left_ins)
|
||||
== display_ins_data_literals(right_obj, right_ins))
|
||||
}
|
||||
|
||||
@@ -564,7 +564,8 @@ pub fn instruction_hover(
|
||||
if let Some(reloc) = resolved.relocation {
|
||||
out.push(HoverItem::Separator);
|
||||
out.append(&mut relocation_hover(obj, reloc, None));
|
||||
if let Some(ty) = obj.arch.guess_data_type(resolved) {
|
||||
let bytes = obj.symbol_data(reloc.relocation.target_symbol).unwrap_or(&[]);
|
||||
if let Some(ty) = obj.arch.guess_data_type(resolved, bytes) {
|
||||
let literals = display_ins_data_literals(obj, resolved);
|
||||
if !literals.is_empty() {
|
||||
out.push(HoverItem::Separator);
|
||||
@@ -758,7 +759,7 @@ pub fn display_ins_data_labels(obj: &Object, resolved: ResolvedInstructionRef) -
|
||||
};
|
||||
let bytes = &data[reloc.relocation.addend as usize..];
|
||||
obj.arch
|
||||
.guess_data_type(resolved)
|
||||
.guess_data_type(resolved, bytes)
|
||||
.map(|ty| ty.display_labels(obj.endianness, bytes))
|
||||
.unwrap_or_default()
|
||||
}
|
||||
@@ -775,7 +776,7 @@ pub fn display_ins_data_literals(obj: &Object, resolved: ResolvedInstructionRef)
|
||||
};
|
||||
let bytes = &data[reloc.relocation.addend as usize..];
|
||||
obj.arch
|
||||
.guess_data_type(resolved)
|
||||
.guess_data_type(resolved, bytes)
|
||||
.map(|ty| ty.display_literals(obj.endianness, bytes))
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user