Skip to content

Commit 7c27010

Browse files
committed
hopefully fix formatting
1 parent 8e6185d commit 7c27010

File tree

5 files changed

+41
-17
lines changed

5 files changed

+41
-17
lines changed

objdiff-core/src/arch/arm.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,11 @@ impl Arch for ArchArm {
457457
if kind == SymbolKind::Function { address & !1 } else { address }
458458
}
459459

460-
fn extra_symbol_flags(&self, symbol: &object::Symbol, _diff_config: &DiffObjConfig) -> SymbolFlagSet {
460+
fn extra_symbol_flags(
461+
&self,
462+
symbol: &object::Symbol,
463+
_diff_config: &DiffObjConfig,
464+
) -> SymbolFlagSet {
461465
let mut flags = SymbolFlagSet::default();
462466
if DisasmMode::from_object_symbol(symbol).is_some() {
463467
flags |= SymbolFlag::Hidden;

objdiff-core/src/arch/mips.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,11 @@ impl Arch for ArchMips {
331331
}
332332
}
333333

334-
fn extra_symbol_flags(&self, symbol: &object::Symbol, _diff_config: &DiffObjConfig) -> SymbolFlagSet {
334+
fn extra_symbol_flags(
335+
&self,
336+
symbol: &object::Symbol,
337+
_diff_config: &DiffObjConfig,
338+
) -> SymbolFlagSet {
335339
let mut flags = SymbolFlagSet::default();
336340
if self.ignored_symbols.contains(&symbol.index().0) {
337341
flags |= SymbolFlag::Ignored;

objdiff-core/src/arch/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,11 @@ pub trait Arch: Any + Debug + Send + Sync {
376376

377377
fn symbol_address(&self, address: u64, _kind: SymbolKind) -> u64 { address }
378378

379-
fn extra_symbol_flags(&self, _symbol: &object::Symbol, _diff_config: &DiffObjConfig) -> SymbolFlagSet {
379+
fn extra_symbol_flags(
380+
&self,
381+
_symbol: &object::Symbol,
382+
_diff_config: &DiffObjConfig,
383+
) -> SymbolFlagSet {
380384
SymbolFlagSet::default()
381385
}
382386

objdiff-core/src/arch/ppc/mod.rs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -357,26 +357,31 @@ impl Arch for ArchPpc {
357357
}
358358
}
359359

360-
fn extra_symbol_flags(&self, symbol: &object::Symbol, diff_config: &DiffObjConfig) -> SymbolFlagSet {
360+
fn extra_symbol_flags(
361+
&self,
362+
symbol: &object::Symbol,
363+
diff_config: &DiffObjConfig,
364+
) -> SymbolFlagSet {
361365
// X360 COFFs should automatically hide all symbols starting with "except_data",
362366
// because those are not functions - they're pointers to exception data structs
363367
if self.extensions.eq(&powerpc::Extensions::xenon()) {
364368
match symbol.name() {
365369
Ok(name) => {
366-
if name.starts_with("except_data_"){
367-
SymbolFlag::Hidden.into()
368-
}
369-
else if name.starts_with("__unwind") && !diff_config.ppc_show_unwinds {
370+
if name.starts_with("except_data_")
371+
|| (name.starts_with("__unwind") && !diff_config.ppc_show_unwinds)
372+
{
370373
SymbolFlag::Hidden.into()
371-
}
372-
else {
374+
} else {
373375
SymbolFlag::none()
374376
}
375377
}
376-
Err(_) => { SymbolFlag::none() }
378+
Err(_) => SymbolFlag::none(),
377379
}
378-
}
379-
else if self.extab.as_ref().is_some_and(|extab| extab.contains_key(&(symbol.index().0 - 1))) {
380+
} else if self
381+
.extab
382+
.as_ref()
383+
.is_some_and(|extab| extab.contains_key(&(symbol.index().0 - 1)))
384+
{
380385
SymbolFlag::HasExtra.into()
381386
} else {
382387
SymbolFlag::none()

objdiff-core/src/obj/read.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fn map_symbol(
4141
symbol: &object::Symbol,
4242
section_indices: &[usize],
4343
split_meta: Option<&SplitMeta>,
44-
diff_config: &DiffObjConfig
44+
diff_config: &DiffObjConfig,
4545
) -> Result<Symbol> {
4646
let mut name = symbol.name().context("Failed to process symbol name")?.to_string();
4747
let mut size = symbol.size();
@@ -118,7 +118,8 @@ fn map_symbols(
118118
if symbol_indices.len() <= obj_symbol.index().0 {
119119
symbol_indices.resize(obj_symbol.index().0 + 1, usize::MAX);
120120
}
121-
let symbol = map_symbol(arch, obj_file, &obj_symbol, section_indices, split_meta, diff_config)?;
121+
let symbol =
122+
map_symbol(arch, obj_file, &obj_symbol, section_indices, split_meta, diff_config)?;
122123
symbol_indices[obj_symbol.index().0] = symbols.len();
123124
symbols.push(symbol);
124125
}
@@ -937,8 +938,14 @@ pub fn parse(data: &[u8], config: &DiffObjConfig) -> Result<Object> {
937938
let split_meta = parse_split_meta(&obj_file)?;
938939
let (mut sections, section_indices) =
939940
map_sections(arch.as_ref(), &obj_file, split_meta.as_ref())?;
940-
let (mut symbols, symbol_indices) =
941-
map_symbols(arch.as_ref(), &obj_file, &sections, &section_indices, split_meta.as_ref(), config)?;
941+
let (mut symbols, symbol_indices) = map_symbols(
942+
arch.as_ref(),
943+
&obj_file,
944+
&sections,
945+
&section_indices,
946+
split_meta.as_ref(),
947+
config,
948+
)?;
942949
map_relocations(arch.as_ref(), &obj_file, &mut sections, &section_indices, &symbol_indices)?;
943950
parse_line_info(&obj_file, &mut sections, &section_indices, data)?;
944951
if config.combine_data_sections || config.combine_text_sections {

0 commit comments

Comments
 (0)