aboutsummaryrefslogtreecommitdiff
path: root/binutils/readelf.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-09-04 12:35:35 +0000
committerH.J. Lu <hjl.tools@gmail.com>2012-09-04 12:35:35 +0000
commitc6d8cab4ac5c906937dcd4f884e65fb4d1052381 (patch)
treed74d960050a0d09e810be75ea778383f3b00c622 /binutils/readelf.c
parent957564c93015991eee194ef0769a3b64b16a2237 (diff)
downloadgdb-c6d8cab4ac5c906937dcd4f884e65fb4d1052381.zip
gdb-c6d8cab4ac5c906937dcd4f884e65fb4d1052381.tar.gz
gdb-c6d8cab4ac5c906937dcd4f884e65fb4d1052381.tar.bz2
Ignore section symbols without a BFD section
bfd/ PR binutils/14493 * elf.c (ignore_section_sym): Also ignore section symbols without a BFD section. binutils/ PR binutils/14493 * readelf.c (get_symbol_index_type): Check bad section index.
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r--binutils/readelf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 89cff24..2fbf2ae 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -8974,6 +8974,8 @@ get_symbol_index_type (unsigned int type)
sprintf (buff, "OS [0x%04x]", type & 0xffff);
else if (type >= SHN_LORESERVE)
sprintf (buff, "RSV[0x%04x]", type & 0xffff);
+ else if (type >= elf_header.e_shnum)
+ sprintf (buff, "bad section index[%3d]", type);
else
sprintf (buff, "%3d", type);
break;