Merge "Fix arguments passed to llvm-readobj"

This commit is contained in:
Yi Kong
2021-09-10 15:15:08 +00:00
committed by Gerrit Code Review

View File

@@ -195,10 +195,12 @@ class ELFParser(object):
@classmethod
def _read_llvm_readobj(cls, elf_file_path, header, llvm_readobj):
"""Run llvm-readobj and parse the output."""
proc = subprocess.Popen(
[llvm_readobj, '-dynamic-table', '-dyn-symbols', elf_file_path],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
cmd = [llvm_readobj, '--dynamic-table', '--dyn-symbols', elf_file_path]
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, _ = proc.communicate()
rc = proc.returncode
if rc != 0:
raise subprocess.CalledProcessError(rc, cmd, out)
lines = out.splitlines()
return cls._parse_llvm_readobj(elf_file_path, header, lines)