Skip to content

Commit 6c060aa

Browse files
committed
hide except_data symbols
1 parent 48804dc commit 6c060aa

File tree

1 file changed

+16
-1
lines changed
  • objdiff-core/src/arch/ppc

1 file changed

+16
-1
lines changed

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,22 @@ impl Arch for ArchPpc {
358358
}
359359

360360
fn extra_symbol_flags(&self, symbol: &object::Symbol) -> SymbolFlagSet {
361-
if self.extab.as_ref().is_some_and(|extab| extab.contains_key(&(symbol.index().0 - 1))) {
361+
// X360 COFFs should automatically hide all symbols starting with "except_data",
362+
// because those are not functions - they're pointers to exception data structs
363+
if self.extensions.eq(&powerpc::Extensions::xenon()) {
364+
match symbol.name() {
365+
Ok(name) => {
366+
if name.starts_with("except_data_"){
367+
SymbolFlag::Hidden.into()
368+
}
369+
else {
370+
SymbolFlag::none()
371+
}
372+
}
373+
Err(_) => { SymbolFlag::none() }
374+
}
375+
}
376+
else if self.extab.as_ref().is_some_and(|extab| extab.contains_key(&(symbol.index().0 - 1))) {
362377
SymbolFlag::HasExtra.into()
363378
} else {
364379
SymbolFlag::none()

0 commit comments

Comments
 (0)