Skip to content

Commit

Permalink
[extract_symbols.py] Fix llvm-readobj options.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
statham-arm committed Nov 11, 2021
1 parent c2ed9fd commit 7ac1fd0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/utils/extract_symbols.py
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 7ac1fd0

Please sign in to comment.