MCPcopy Index your code
hub / github.com/encounter/objdiff / no_diff_data_section

Function no_diff_data_section

objdiff-core/src/diff/data.rs:206–227  ·  view source on GitHub ↗
(obj: &Object, section_idx: usize)

Source from the content-addressed store, hash-verified

204}
205
206pub fn no_diff_data_section(obj: &Object, section_idx: usize) -> Result<SectionDiff> {
207 let section = &obj.sections[section_idx];
208
209 let data_diff = vec![DataDiff {
210 data: section.data.0.clone(),
211 kind: DataDiffKind::None,
212 size: section.data.len(),
213 }];
214
215 let mut reloc_diffs = Vec::new();
216 for reloc in section.relocations.iter() {
217 let reloc_len = obj.arch.data_reloc_size(reloc.flags);
218 let range = reloc.address..reloc.address + reloc_len as u64;
219 reloc_diffs.push(DataRelocationDiff {
220 reloc: reloc.clone(),
221 kind: DataDiffKind::None,
222 range,
223 });
224 }
225
226 Ok(SectionDiff { match_percent: Some(0.0), data_diff, reloc_diff: reloc_diffs })
227}
228
229/// Compare the data sections of two object files.
230pub fn diff_data_section(

Callers 1

diff_objsFunction · 0.85

Calls 2

pushMethod · 0.80
data_reloc_sizeMethod · 0.45

Tested by

no test coverage detected