Skip to content

Commit 8b5bf21

Browse files
committed
Mark combined sections as SectionKind::Unknown
1 parent b77df77 commit 8b5bf21

File tree

5 files changed

+62
-63
lines changed

5 files changed

+62
-63
lines changed

objdiff-core/src/diff/display.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ pub fn display_sections(
684684
.collect::<Vec<_>>();
685685
if let Some(section_idx) = section_idx {
686686
let section = &obj.sections[section_idx];
687-
if section.kind == SectionKind::Unknown || section.flags.contains(SectionFlag::Hidden) {
687+
if section.kind == SectionKind::Unknown {
688688
// Skip unknown and hidden sections
689689
continue;
690690
}

objdiff-core/src/obj/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ flags! {
5757
pub enum SectionFlag: u8 {
5858
/// Section combined from multiple input sections
5959
Combined,
60-
Hidden,
6160
}
6261
}
6362

objdiff-core/src/obj/read.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ fn do_combine_sections(
764764
line_info.append(&mut section.line_info.iter().map(|(&a, &l)| (a + offset, l)).collect());
765765
section.line_info.clear();
766766
if offset > 0 {
767-
section.flags |= SectionFlag::Hidden;
767+
section.kind = SectionKind::Unknown;
768768
}
769769
}
770770
{

objdiff-core/src/obj/snapshots/objdiff_core__obj__read__test__combine_sections.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ expression: "(sections, symbols)"
8484
name: ".data",
8585
address: 0,
8686
size: 0,
87-
kind: Data,
87+
kind: Unknown,
8888
data: SectionData(
8989
0,
9090
),
91-
flags: FlagSet(Hidden),
91+
flags: FlagSet(),
9292
align: None,
9393
relocations: [],
9494
line_info: {},
@@ -99,11 +99,11 @@ expression: "(sections, symbols)"
9999
name: ".data",
100100
address: 0,
101101
size: 0,
102-
kind: Data,
102+
kind: Unknown,
103103
data: SectionData(
104104
0,
105105
),
106-
flags: FlagSet(Hidden),
106+
flags: FlagSet(),
107107
align: None,
108108
relocations: [],
109109
line_info: {},

0 commit comments

Comments
 (0)