From: Seva Alekseyev Date: Fri, 17 Jun 2022 14:04:44 +0000 (-0400) Subject: Readelf upgraded to 2.38, format fixes (#420) X-Git-Tag: v0.29~14 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6a33969cbd89a95034b280d6767734b260ef774b;p=pyelftools.git Readelf upgraded to 2.38, format fixes (#420) --- diff --git a/scripts/readelf.py b/scripts/readelf.py index 070032a..7b2bb55 100755 --- a/scripts/readelf.py +++ b/scripts/readelf.py @@ -1142,14 +1142,11 @@ class ReadElf(object): cu_filename = bytes2str(lineprogram['file_entry'][0].name) if len(lineprogram['include_directory']) > 0: - dir_index = lineprogram['file_entry'][0].dir_index - if dir_index > 0: - dir = lineprogram['include_directory'][dir_index - 1] - else: - dir = b'.' - cu_filename = '%s/%s' % (bytes2str(dir), cu_filename) - - self._emitline('CU: %s:' % cu_filename) + # GNU readelf 2.38 only outputs directory in wide mode + self._emitline('%s:' % cu_filename) + else: + self._emitline('CU: %s:' % cu_filename) + self._emitline('File name Line number Starting address Stmt') # GNU readelf has a View column that we don't try to replicate # The autotest has logic in place to ignore that diff --git a/test/external_tools/readelf b/test/external_tools/readelf index 95494d5..f7df456 100755 Binary files a/test/external_tools/readelf and b/test/external_tools/readelf differ