[llvm] 7ac1fd0 - [extract_symbols.py] Fix llvm-readobj options.

Simon Tatham via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 11 01:13:18 PST 2021


Author: Simon Tatham
Date: 2021-11-11T09:12:58Z
New Revision: 7ac1fd0da9931be7ab787e2960357c1ce9d91479

URL: https://github.com/llvm/llvm-project/commit/7ac1fd0da9931be7ab787e2960357c1ce9d91479
DIFF: https://github.com/llvm/llvm-project/commit/7ac1fd0da9931be7ab787e2960357c1ce9d91479.diff

LOG: [extract_symbols.py] Fix llvm-readobj options.

As of D105532, a couple of llvm-readobj options have slightly changed
their spellings. '-file-headers' has become '--file-header', and
'-symbols' has become '--symbols'. A modern llvm-readobj will respond
to those single-dash spellings by trying to parse them as combinations
of single-letter options, so that you get "unknown argument '-f'" for
-file-headers, and "unknown argument '-y'" for the second letter of
-symbols.

extract_symbols.py was still invoking llvm-readobj with those old
single-dash spellings. Changed them to the newly canonical ones, which
as far as I can tell still work on llvm-readobj from before the
change.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D113556

Added: 
    

Modified: 
    llvm/utils/extract_symbols.py

Removed: 
    


################################################################################
diff  --git a/llvm/utils/extract_symbols.py b/llvm/utils/extract_symbols.py
index d9d89093f3d3..21c976814342 100755
--- a/llvm/utils/extract_symbols.py
+++ b/llvm/utils/extract_symbols.py
@@ -64,7 +64,7 @@ def nm_get_symbols(lib):
     process.wait()
 
 def readobj_get_symbols(lib):
-    process = subprocess.Popen(['llvm-readobj','-symbols',lib], bufsize=1,
+    process = subprocess.Popen(['llvm-readobj','--symbols',lib], bufsize=1,
                                stdout=subprocess.PIPE, stdin=subprocess.PIPE,
                                universal_newlines=True)
     process.stdin.close()
@@ -118,7 +118,7 @@ def objdump_is_32bit_windows(lib):
     return False
 
 def readobj_is_32bit_windows(lib):
-    output = subprocess.check_output(['llvm-readobj','-file-headers',lib],
+    output = subprocess.check_output(['llvm-readobj','--file-header',lib],
                                      universal_newlines=True)
     for line in output:
         match = re.match('Format: (\S+)', line)


        


More information about the llvm-commits mailing list