Skip to content

Commit 9a968e9

Browse files
committed
analyze_code_size.py: Handle object files and dylibs
1 parent 60fbf61 commit 9a968e9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

utils/analyze_code_size.py

+9
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,9 @@ def parse_segments(path, arch):
259259
segment_regex = re.compile(
260260
r"^ 0x[0-9a-f]+ \(\s*0x(?P<size>[0-9a-f]+)\) "
261261
r"(?P<name>.+?) (?P<name2>.+?)$")
262+
object_file_segment_regex = re.compile(
263+
r"^ 0x[0-9a-f]+ \(\s*0x(?P<size>[0-9a-f]+)\) "
264+
r"SEGMENT$")
262265
section_regex = re.compile(
263266
r"^ 0x[0-9a-f]+ \(\s*0x(?P<size>[0-9a-f]+)\) "
264267
r"(?P<name>.+?) (?P<name2>.+?)$")
@@ -280,6 +283,12 @@ def parse_segments(path, arch):
280283
segments.append(new_segment)
281284
continue
282285

286+
object_file_segment_match = object_file_segment_regex.match(line)
287+
if object_file_segment_match:
288+
new_segment = Segment("SEGMENT")
289+
segments.append(new_segment)
290+
continue
291+
283292
# Match a section entry.
284293
section_match = section_regex.match(line)
285294
if section_match:

0 commit comments

Comments
 (0)