diff options
author | Job Noorman <jnoorman@igalia.com> | 2023-05-16 09:23:26 +0200 |
---|---|---|
committer | Job Noorman <jnoorman@igalia.com> | 2023-05-16 09:25:06 +0200 |
commit | 8a5a12057e9e324c73e962d8fc9c6dfdbad31dcb (patch) | |
tree | 656718bd2e912a4fa621b867ef9d2b9b6f8e3381 /bolt | |
parent | 4054c68644dfebbb584bca698a25d18d1d312bae (diff) | |
download | llvm-8a5a12057e9e324c73e962d8fc9c6dfdbad31dcb.zip llvm-8a5a12057e9e324c73e962d8fc9c6dfdbad31dcb.tar.gz llvm-8a5a12057e9e324c73e962d8fc9c6dfdbad31dcb.tar.bz2 |
[BOLT][Wrapper] Fix off-by-one in find_section upper limit
find_section used to match offsets equal to file_offset + size causing
offsets to sometimes be attributed to the wrong section.
Reviewed By: Amir
Differential Revision: https://reviews.llvm.org/D149047
Diffstat (limited to 'bolt')
-rwxr-xr-x | bolt/utils/llvm-bolt-wrapper.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bolt/utils/llvm-bolt-wrapper.py b/bolt/utils/llvm-bolt-wrapper.py index a6d863c..901304d 100755 --- a/bolt/utils/llvm-bolt-wrapper.py +++ b/bolt/utils/llvm-bolt-wrapper.py @@ -246,7 +246,7 @@ def find_section(offset, readelf_hdr): file_offset = int(cols[5], 16) # section size size = int(cols[2], 16) - if offset >= file_offset and offset <= file_offset + size: + if offset >= file_offset and offset < file_offset + size: if sys.stdout.isatty(): # terminal supports colors print(f"\033[1m{line}\033[0m") else: |