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. -->
This commit is contained in:
Scott McKay 2024-10-25 08:14:15 +10:00 committed by GitHub
parent 3ae7c3c0a6
commit b9903617b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -34,8 +34,13 @@ def get_section_sizes(binary_path, readelf_path, dump_to_file=None):
for match in re.finditer(r"\[[\s\d]+\] (\..*)$", output, re.MULTILINE):
items = match.group(1).split()
name = items[0]
if name == ".relro_padding":
# padding fluctuates and isn't due to the actual code. as it adds noise to the diff exclude it
continue
# convert size from hex to int
size = int(items[4], 16)
section_sizes[name] = size
if dump_to_file: