|
1 | | -# nulls the timestamp filed in a windows .lib archive, |
2 | | -# making the lib reproducable. |
| 1 | +# nulls the timestamp field in a windows .lib archive, |
| 2 | +# making the lib reproducible. |
3 | 3 | # the time is the TimeDateStamp in the COFF file header, four bytes at offset 4 |
4 | 4 | # See https://blog.conan.io/2019/09/02/Deterministic-builds-with-C-C++.html |
5 | 5 | # also: https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#archive-library-file-format |
6 | 6 | # |
7 | | -# There are some additional fixes added for reproducability, such as fixing the zero-padding of names in the coff |
| 7 | +# There are some additional fixes added for reproducibility, such as fixing the zero-padding of names in the coff |
8 | 8 | # section headers. |
9 | 9 |
|
10 | 10 | import struct |
@@ -82,7 +82,7 @@ def read_lib(fp): |
82 | 82 | print("longnames", result["longnames"]) |
83 | 83 | h = None |
84 | 84 |
|
85 | | - # now read the headers, possibly we alread read one above. |
| 85 | + # now read the headers, possibly we already read one above. |
86 | 86 | while True: |
87 | 87 | if h is None: |
88 | 88 | h = header_read(fp) |
@@ -202,13 +202,13 @@ def first_lm_write(fp, lm): |
202 | 202 |
|
203 | 203 | def second_lm_read(fp): |
204 | 204 | # number of members |
205 | | - m = struct.unpack("<L", fp.read(4))[0] # unsigned long, big-endian |
| 205 | + m = struct.unpack("<L", fp.read(4))[0] # unsigned long, little-endian |
206 | 206 | offsets = [] |
207 | 207 | for _ in range(m): |
208 | 208 | offsets.append(struct.unpack("<L", fp.read(4))[0]) |
209 | 209 |
|
210 | 210 | # number of symbols |
211 | | - n = struct.unpack("<L", fp.read(4))[0] # unsigned long, big-endian |
| 211 | + n = struct.unpack("<L", fp.read(4))[0] # unsigned long, little-endian |
212 | 212 | indices = [] |
213 | 213 | for _ in range(n): |
214 | 214 | indices.append(struct.unpack("<H", fp.read(2))[0]) # unsigned short |
|
0 commit comments