more horrible hacks to run_readelf_tests to pass with a newer readelf on 32-bit
diff --git a/tests/run_readelf_tests.py b/tests/run_readelf_tests.py
index ca3b656..5a5fbd7 100755
--- a/tests/run_readelf_tests.py
+++ b/tests/run_readelf_tests.py
@@ -13,6 +13,7 @@
import logging
import subprocess
import tempfile
+import platform
# Create a global logger object
@@ -121,7 +122,9 @@
flag_after_symtable = True
# Compare ignoring whitespace
- if lines1[i].split() != lines2[i].split():
+ lines1_parts = lines1[i].split()
+ lines2_parts = lines2[i].split()
+ if ''.join(lines1_parts) != ''.join(lines2_parts):
ok = False
sm = SequenceMatcher()
sm.set_seqs(lines1[i], lines2[i])
@@ -132,6 +135,15 @@
if ( len(changes) == 2 and changes[1][0] == 'delete' and
lines1[i][changes[1][1]] == '@'):
ok = True
+ elif 'at_const_value' in lines1[i]:
+ # On 32-bit machines, readelf doesn't correctly represent
+ # some boundary LEB128 numbers
+ num2 = int(lines2_parts[-1])
+ if num2 <= -2**31 and '32' in platform.architecture()[0]:
+ ok = True
+ elif 'os/abi' in lines1[i]:
+ if 'unix - gnu' in lines1[i] and 'unix - linux' in lines2[i]:
+ ok = True
else:
for s in ('t (tls)', 'l (large)'):
if s in lines1[i] or s in lines2[i]: