mirror of
https://github.com/encounter/objdiff.git
synced 2026-07-10 12:18:36 -07:00
Significantly improve diffing performance and fix minor bug with bss section match percents (#316)
* Move symbol name processing from diff step to read step * Use min_by_key instead of sorted_unstable_by_key * Sort all symbols by address when reading the object This fixes an underreport bug in diff_bss_section. * More symbol sorting logic on read * Move is_name_compiler_generated into SymbolFlag & filter out File symbols --------- Co-authored-by: Luke Street <luke@street.dev>
This commit is contained in:
@@ -812,19 +812,15 @@ pub fn display_sections(
|
||||
}
|
||||
let section_diff = &diff.sections[section_idx];
|
||||
let reverse_fn_order = section.kind == SectionKind::Code && reverse_fn_order;
|
||||
symbols.sort_by(|a, b| {
|
||||
let a = &obj.symbols[a.symbol];
|
||||
let b = &obj.symbols[b.symbol];
|
||||
section_symbol_sort(a, b)
|
||||
.then_with(|| {
|
||||
if reverse_fn_order {
|
||||
b.address.cmp(&a.address)
|
||||
} else {
|
||||
a.address.cmp(&b.address)
|
||||
}
|
||||
})
|
||||
.then_with(|| a.size.cmp(&b.size))
|
||||
});
|
||||
if reverse_fn_order {
|
||||
symbols.sort_by(|a, b| {
|
||||
let a = &obj.symbols[a.symbol];
|
||||
let b = &obj.symbols[b.symbol];
|
||||
section_symbol_sort(a, b)
|
||||
.then_with(|| b.address.cmp(&a.address))
|
||||
.then_with(|| a.size.cmp(&b.size))
|
||||
});
|
||||
}
|
||||
sections.push(SectionDisplay {
|
||||
id: section.id.clone(),
|
||||
name: if section.flags.contains(SectionFlag::Combined) {
|
||||
|
||||
Reference in New Issue
Block a user