diff --git a/scripts/readelf.py b/scripts/readelf.py index 2a7d49c8..1cbc1adf 100755 --- a/scripts/readelf.py +++ b/scripts/readelf.py @@ -487,7 +487,7 @@ def display_symbol_tables(self): symbol_name = symbol.name # Print section names for STT_SECTION symbols as readelf does if (symbol['st_info']['type'] == 'STT_SECTION' - and symbol['st_shndx'] < self.elffile.num_sections() + and (type(symbol['st_shndx']) == int and symbol['st_shndx'] < self.elffile.num_sections()) and symbol['st_name'] == 0): symbol_name = self.elffile.get_section(symbol['st_shndx']).name