mirror of
https://github.com/encounter/objdiff.git
synced 2026-07-10 12:18:36 -07:00
merge gnu function and data sections (#327)
This commit is contained in:
@@ -874,8 +874,12 @@ fn combine_sections(
|
||||
let mut data_sections = BTreeMap::<String, Vec<usize>>::new();
|
||||
let mut text_sections = BTreeMap::<String, Vec<usize>>::new();
|
||||
for (i, section) in sections.iter().enumerate() {
|
||||
let base_name =
|
||||
if let Some(i) = section.name.rfind('$') { §ion.name[..i] } else { §ion.name };
|
||||
let base_name = section
|
||||
.name
|
||||
.get(1..)
|
||||
.and_then(|s| s.rfind(['$', '.']))
|
||||
.and_then(|i| section.name.get(..i + 1))
|
||||
.unwrap_or(§ion.name);
|
||||
match section.kind {
|
||||
SectionKind::Data | SectionKind::Bss => {
|
||||
data_sections.entry(base_name.to_string()).or_default().push(i);
|
||||
|
||||
Reference in New Issue
Block a user