[MIPS] Fix symbols being filtered out from target side of diff if target object contains .NON_MATCHING markers (#250)

* Fix filtering out symbols from the target side that have a symbol with the same name and a `.NON_MATCHING` suffix.

- Target side: Show all the symbols except the `.NON_MATCHING` ones.
- Base side: Ignore all the `.NON_MATCHING` symbols and also ignore the ones with the same name without the suffix

* fmt

* comment

* tests

* fmt tests

* maybe this could fix wasm?

* Fix wasm?

* fmt

* Move `DiffSide` to `diff` mod

* Update the stuff the advisories CI told me to
This commit is contained in:
Anghelo Carvajal
2025-09-02 21:13:29 -04:00
committed by GitHub
parent a138dfa907
commit 6fb4bb8855
13 changed files with 169 additions and 44 deletions

View File

@@ -8,8 +8,8 @@ use objdiff_core::{
Report, ReportCategory, ReportItem, ReportItemMetadata, ReportUnit, ReportUnitMetadata,
},
config::path::platform_path,
diff, obj,
obj::{SectionKind, SymbolFlag},
diff,
obj::{self, SectionKind, SymbolFlag},
};
use prost::Message;
use rayon::iter::{IntoParallelRefIterator, ParallelIterator};
@@ -177,14 +177,16 @@ fn report_object(
.target_path
.as_ref()
.map(|p| {
obj::read::read(p.as_ref(), diff_config).with_context(|| format!("Failed to open {p}"))
obj::read::read(p.as_ref(), diff_config, diff::DiffSide::Target)
.with_context(|| format!("Failed to open {p}"))
})
.transpose()?;
let base = object
.base_path
.as_ref()
.map(|p| {
obj::read::read(p.as_ref(), diff_config).with_context(|| format!("Failed to open {p}"))
obj::read::read(p.as_ref(), diff_config, diff::DiffSide::Base)
.with_context(|| format!("Failed to open {p}"))
})
.transpose()?;
let result =