Skip to content

Commit b990361

Browse files
authored
Exclude padding section from minimal build size report (#22578)
### Description <!-- Describe your changes. --> Should make the binary size report more stable as changes < 4K can occur when a padding boundary is crossed. ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. -->
1 parent 3ae7c3c commit b990361

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/ci_build/github/linux/ort_minimal/readelf_utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@ def get_section_sizes(binary_path, readelf_path, dump_to_file=None):
3434
for match in re.finditer(r"\[[\s\d]+\] (\..*)$", output, re.MULTILINE):
3535
items = match.group(1).split()
3636
name = items[0]
37+
if name == ".relro_padding":
38+
# padding fluctuates and isn't due to the actual code. as it adds noise to the diff exclude it
39+
continue
40+
3741
# convert size from hex to int
3842
size = int(items[4], 16)
43+
3944
section_sizes[name] = size
4045

4146
if dump_to_file:

0 commit comments

Comments
 (0)