diff --git a/scripts/readelf.py b/scripts/readelf.py index 2a7d49c8..da021dd0 100755 --- a/scripts/readelf.py +++ b/scripts/readelf.py @@ -487,6 +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'] != 'SHN_UNDEF' and symbol['st_shndx'] < self.elffile.num_sections() and symbol['st_name'] == 0): symbol_name = self.elffile.get_section(symbol['st_shndx']).name