Skip to content

Commit 3e74225

Browse files
committed
Implement $ splitting for section names too
1 parent 8807580 commit 3e74225

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

objdiff-core/src/diff/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,13 @@ where
650650

651651
fn symbol_section<'obj>(obj: &'obj Object, symbol: &Symbol) -> Option<(&'obj str, SectionKind)> {
652652
if let Some(section) = symbol.section.and_then(|section_idx| obj.sections.get(section_idx)) {
653-
Some((section.name.as_str(), section.kind))
653+
// Match x86 .rdata$r against .rdata$rs
654+
let section_name = if let Some((prefix, _)) = section.name.split_once('$') {
655+
prefix
656+
} else {
657+
section.name.as_str()
658+
};
659+
Some((section_name, section.kind))
654660
} else if symbol.flags.contains(SymbolFlag::Common) {
655661
Some((".comm", SectionKind::Common))
656662
} else {

0 commit comments

Comments
 (0)