(obj: &Object, section_idx: usize)
| 204 | } |
| 205 | |
| 206 | pub 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. |
| 230 | pub fn diff_data_section( |
no test coverage detected