From 02b409336fd3deb9fac9f71694daf76776810c55 Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Thu, 28 Nov 2013 09:10:22 -0800 Subject: [PATCH] exe_simple64 now passes again --- elftools/dwarf/descriptions.py | 2 +- scripts/readelf.py | 8 ++++---- test/external_tools/README.txt | 2 +- test/run_readelf_tests.py | 2 -- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/elftools/dwarf/descriptions.py b/elftools/dwarf/descriptions.py index f46ef81..ca00cd1 100644 --- a/elftools/dwarf/descriptions.py +++ b/elftools/dwarf/descriptions.py @@ -82,7 +82,7 @@ def describe_CFI_instructions(entry): 'DW_CFA_advance_loc4', 'DW_CFA_advance_loc'): _assert_FDE_instruction(instr) factored_offset = instr.args[0] * cie['code_alignment_factor'] - s += ' %s: %s to %08x\n' % ( + s += ' %s: %s to %016x\n' % ( name, factored_offset, factored_offset + pc) pc += factored_offset elif name in ( 'DW_CFA_remember_state', 'DW_CFA_restore_state', diff --git a/scripts/readelf.py b/scripts/readelf.py index 9839f71..c3215b3 100755 --- a/scripts/readelf.py +++ b/scripts/readelf.py @@ -923,7 +923,7 @@ class ReadElf(object): for entry in self._dwarfinfo.CFI_entries(): if isinstance(entry, CIE): - self._emitline('\n%08x %08x %08x CIE' % ( + self._emitline('\n%08x %016x %016x CIE' % ( entry.offset, entry['length'], entry['CIE_id'])) self._emitline(' Version: %d' % entry['version']) self._emitline(' Augmentation: "%s"' % bytes2str(entry['augmentation'])) @@ -932,7 +932,7 @@ class ReadElf(object): self._emitline(' Return address column: %d' % entry['return_address_register']) self._emitline() else: # FDE - self._emitline('\n%08x %08x %08x FDE cie=%08x pc=%08x..%08x' % ( + self._emitline('\n%08x %016x %016x FDE cie=%08x pc=%016x..%016x' % ( entry.offset, entry['length'], entry['CIE_pointer'], @@ -953,7 +953,7 @@ class ReadElf(object): for entry in self._dwarfinfo.CFI_entries(): if isinstance(entry, CIE): - self._emitline('\n%08x %08x %08x CIE "%s" cf=%d df=%d ra=%d' % ( + self._emitline('\n%08x %016x %016x CIE "%s" cf=%d df=%d ra=%d' % ( entry.offset, entry['length'], entry['CIE_id'], @@ -963,7 +963,7 @@ class ReadElf(object): entry['return_address_register'])) ra_regnum = entry['return_address_register'] else: # FDE - self._emitline('\n%08x %08x %08x FDE cie=%08x pc=%08x..%08x' % ( + self._emitline('\n%08x %016x %016x FDE cie=%08x pc=%016x..%016x' % ( entry.offset, entry['length'], entry['CIE_pointer'], diff --git a/test/external_tools/README.txt b/test/external_tools/README.txt index 1d7e48a..3380cce 100644 --- a/test/external_tools/README.txt +++ b/test/external_tools/README.txt @@ -1,4 +1,4 @@ Some utilities that use libelf to create synthetic ELF files Also, readelf picked up from a built binutils. Run it with --version to version -details. +details. The binary is built on a 64-bit Ubuntu machine. diff --git a/test/run_readelf_tests.py b/test/run_readelf_tests.py index b65425e..afaf6c5 100755 --- a/test/run_readelf_tests.py +++ b/test/run_readelf_tests.py @@ -30,8 +30,6 @@ READELF_PATH = 'test/external_tools/readelf' if not os.path.exists(READELF_PATH): READELF_PATH = 'readelf' -print(READELF_PATH) - def discover_testfiles(rootdir): """ Discover test files in the given directory. Yield them one by one. """ -- 2.30.2