From 1cb3e15d3c625fe890992e23fba60c51c315ae36 Mon Sep 17 00:00:00 2001 From: Seva Alekseyev Date: Wed, 23 Oct 2024 15:37:31 -0400 Subject: [PATCH] Check for SHN_UNDEF during symbol dumping --- scripts/readelf.py | 1 + 1 file changed, 1 insertion(+) 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