summaryrefslogtreecommitdiff
path: root/bolt
diff options
context:
space:
mode:
authorJob Noorman <jnoorman@igalia.com>2023-05-16 09:23:26 +0200
committerJob Noorman <jnoorman@igalia.com>2023-05-16 09:25:06 +0200
commit8a5a12057e9e324c73e962d8fc9c6dfdbad31dcb (patch)
tree656718bd2e912a4fa621b867ef9d2b9b6f8e3381 /bolt
parent4054c68644dfebbb584bca698a25d18d1d312bae (diff)
downloadllvm-8a5a12057e9e324c73e962d8fc9c6dfdbad31dcb.tar.gz
[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-xbolt/utils/llvm-bolt-wrapper.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bolt/utils/llvm-bolt-wrapper.py b/bolt/utils/llvm-bolt-wrapper.py
index a6d863ce7caa..901304d134ee 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: