From c1a8b8a10d00fc016e6da50f3ad54f8510a46a49 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Wed, 4 Jul 2018 20:51:25 -0400 Subject: [PATCH] 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. --- python/mozbuild/mozbuild/action/check_binary.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/mozbuild/mozbuild/action/check_binary.py b/python/mozbuild/mozbuild/action/check_binary.py index aafd191f99b2..4cc6beaca294 100644 --- a/python/mozbuild/mozbuild/action/check_binary.py +++ b/python/mozbuild/mozbuild/action/check_binary.py @@ -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]