Minor tweaks to ml.py.
- Remove a partial comment fragment left over from before I rewrote the comment.
- Check all sections for absence of line numbers; stopping at debug_section_index
was a leftover from when I thought the debug section was always last
No intended behavior change.
Bug: none
Change-Id: Ie278420ed2959fe7dc473cf0739fe54c45af1380
Reviewed-on: https://chromium-review.googlesource.com/c/1306645
Reviewed-by: Hans Wennborg <hans@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#603874}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b1426e9d748920ca9d44d5f2eae0920d9da51631
diff --git a/win/ml.py b/win/ml.py
index 22e3934..877c584 100755
--- a/win/ml.py
+++ b/win/ml.py
@@ -91,7 +91,7 @@
for i in range(0, coff_header.NumberOfSections):
section_header = SECTIONHEADER.unpack_from(
objdata, offset=COFFHEADER.size() + i * SECTIONHEADER.size())
- assert not section_header[0].startswith('/') # Support only short names.
+ assert not section_header[0].startswith('/') # Support short names only.
section_headers.append(section_header)
if section_header.Name == '.debug$S':
@@ -102,7 +102,6 @@
data_start = COFFHEADER.size() + len(section_headers) * SECTIONHEADER.size()
# Verify the .debug$S section looks like we expect.
- # have their data before the .debug$S's section data.
assert section_headers[debug_section_index].Name == '.debug$S'
assert section_headers[debug_section_index].VirtualSize == 0
assert section_headers[debug_section_index].VirtualAddress == 0
@@ -207,8 +206,8 @@
REL.pack_into(objdata, rel_offset, rel)
# Update symbol table indices in line numbers -- just check they don't exist.
- for i in range(0, debug_section_index):
- assert section_headers[i].NumberOfLineNumbers == 0
+ for header in section_headers:
+ assert header.NumberOfLineNumbers == 0
# Now that all indices are updated, remove the symbol table entry refering to
# .debug$S and its aux entry.