Bug 1684291 - Correct generation of dependentlibs.list when using llvm-readelf. r=mhentges

Call strip on the returned output to account for the whitespace differing
between llvm-readelf and GNU's readelf, also update the tmp variable index to
account for stripping the leading whitespace.

Differential Revision: https://phabricator.services.mozilla.com/D101459
This commit is contained in:
Nordin Abouzahra 2021-01-12 14:34:08 +00:00
parent f948bc5bd5
commit c0642feb5a

View File

@ -55,8 +55,8 @@ def dependentlibs_readelf(lib):
# or with BSD readelf:
# tag TYPE value
# Looking for NEEDED type entries
tmp = line.split(" ", 3)
if len(tmp) > 3 and "NEEDED" in tmp[2]:
tmp = line.strip().split(" ", 3)
if len(tmp) > 3 and "NEEDED" in tmp[1]:
# NEEDED lines look like:
# 0x00000001 (NEEDED) Shared library: [libname]
# or with BSD readelf: