From: Eli Bendersky Date: Sun, 31 Mar 2013 00:47:32 +0000 (-0700) Subject: Fix some other differences from the output of readelf in binutils 2.23 X-Git-Tag: v0.21~17 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1b928ce3bf0521548602bceebd9bfb498184e066;p=pyelftools.git Fix some other differences from the output of readelf in binutils 2.23 --- diff --git a/.hgignore b/.hgignore index b5fbdde..4e7e920 100644 --- a/.hgignore +++ b/.hgignore @@ -8,5 +8,6 @@ tags build dist MANIFEST +*.sublime-workspace diff --git a/elftools/dwarf/descriptions.py b/elftools/dwarf/descriptions.py index 28b4678..987e0d0 100644 --- a/elftools/dwarf/descriptions.py +++ b/elftools/dwarf/descriptions.py @@ -199,7 +199,7 @@ def _describe_attr_debool(attr, die, section_offset): def _describe_attr_block(attr, die, section_offset): s = '%s byte block: ' % len(attr.value) - s += ' '.join('%x' % item for item in attr.value) + s += ' '.join('%x' % item for item in attr.value) + ' ' return s @@ -213,7 +213,7 @@ _ATTR_DESCRIPTION_MAP = defaultdict( DW_FORM_ref_udata=_describe_attr_ref, DW_FORM_ref_addr=_describe_attr_hex_addr, DW_FORM_data4=_describe_attr_hex, - DW_FORM_data8=_describe_attr_split_64bit, + DW_FORM_data8=_describe_attr_hex, DW_FORM_addr=_describe_attr_hex, DW_FORM_sec_offset=_describe_attr_hex, DW_FORM_flag=_describe_attr_debool, diff --git a/test/run_readelf_tests.py b/test/run_readelf_tests.py index 6c822cc..933788b 100755 --- a/test/run_readelf_tests.py +++ b/test/run_readelf_tests.py @@ -134,7 +134,8 @@ def compare_output(s1, s2): 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]) + val = lines2_parts[-1] + num2 = int(val, 16 if val.startswith('0x') else 10) if num2 <= -2**31 and '32' in platform.architecture()[0]: ok = True elif 'os/abi' in lines1[i]: