Bug 1473291 - handle valueless dynamic section entries; r=glandium

Some dynamic entry types, like DT_BIND_NOW, are printed without a value
by readelf.  Handle such types gracefully.
This commit is contained in:
Nathan Froyd 2018-07-04 20:51:25 -04:00
Родитель e4c49c7635
Коммит c1a8b8a10d
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -101,7 +101,7 @@ def iter_readelf_symbols(target, binary):
def iter_readelf_dynamic(target, binary):
for line in get_output(target['readelf'], '-d', binary):
data = line.split(None, 2)
if data and data[0].startswith('0x'):
if data and len(data) == 3 and data[0].startswith('0x'):
yield data[1].rstrip(')').lstrip('('), data[2]