File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -52,9 +52,9 @@ fn map_symbol(
52
52
53
53
let section_kind = map_section_kind ( & section) ;
54
54
if section_kind == SectionKind :: Data {
55
- // For section symbols, the size would normally be zero and excluded from the diff.
56
- // Instead we make them the size of all the data in the section so that the user can diff
57
- // entire sections by clicking on the section symbol at the top of the section.
55
+ // For data section symbols, the size would normally be zero and excluded from the diff.
56
+ // Instead we make them the size of all the data in the section so that the user can
57
+ // diff entire sections by clicking on the section symbol at the top of the section.
58
58
// We only do this for data sections, as there would be no point for code or bss sections.
59
59
if let Some ( last_symbol) = file
60
60
. symbols ( )
@@ -72,6 +72,13 @@ fn map_symbol(
72
72
// so only fall back to it if there are no symbols to look at.
73
73
size = section. size ( ) ;
74
74
}
75
+ } else {
76
+ // For non-data section symbols, set the size to zero. If the size is non-zero, it will
77
+ // be included in the diff. Most of the time, this is duplicative, given that we'll have
78
+ // function or object symbols that cover the same range. In the case of an empty
79
+ // section, the size inference logic below will set the size back to the section size,
80
+ // thus acting as a placeholder symbol.
81
+ size = 0 ;
75
82
}
76
83
}
77
84
You can’t perform that action at this time.
0 commit comments