Readelf upgraded to 2.38, format fixes (#420)
authorSeva Alekseyev <sevaa@yarxi.ru>
Fri, 17 Jun 2022 14:04:44 +0000 (10:04 -0400)
committerGitHub <noreply@github.com>
Fri, 17 Jun 2022 14:04:44 +0000 (07:04 -0700)
scripts/readelf.py
test/external_tools/readelf

index 070032ab5f6773b0a7a3f691c566b652c0ed681e..7b2bb55d91e186a14d723fe871f4f926e7ed6245 100755 (executable)
@@ -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
index 95494d525ac58ae3dec9d8e0f480efed4728709f..f7df45636d5206357d151cc99bcc905af4da1887 100755 (executable)
Binary files a/test/external_tools/readelf and b/test/external_tools/readelf differ