[PATCH] D113556: [extract_symbols.py] Fix llvm-readobj options.

Simon Tatham via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 10 03:41:09 PST 2021


simon_tatham created this revision.
simon_tatham added a reviewer: MaskRay.
simon_tatham requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

As of D105532 <https://reviews.llvm.org/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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113556

Files:
  llvm/utils/extract_symbols.py


Index: llvm/utils/extract_symbols.py
===================================================================
--- llvm/utils/extract_symbols.py
+++ llvm/utils/extract_symbols.py
@@ -64,7 +64,7 @@
     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 @@
     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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113556.386111.patch
Type: text/x-patch
Size: 925 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211110/6ba6a4fb/attachment.bin>


More information about the llvm-commits mailing list