From c6d8cab4ac5c906937dcd4f884e65fb4d1052381 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 4 Sep 2012 12:35:35 +0000 Subject: 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. --- binutils/ChangeLog | 39 ++++++++++++++++++++++----------------- binutils/readelf.c | 2 ++ 2 files changed, 24 insertions(+), 17 deletions(-) (limited to 'binutils') diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 922396a..5c6fcb7 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2012-09-04 H.J. Lu + + PR binutils/14493 + * readelf.c (get_symbol_index_type): Check bad section index. + 2012-08-24 Matthew Gretton-Dann * readelf.c (arm_attr_tag_CPU_arch): Update for ARMv8. @@ -20,15 +25,15 @@ * bfdtest1.c: New file. 2012-08-13 Ian Bolton - Laurent Desnogues - Jim MacArthur - Marcus Shawcroft - Nigel Stephens - Ramana Radhakrishnan - Richard Earnshaw - Sofiane Naci - Tejas Belagod - Yufeng Zhang + Laurent Desnogues + Jim MacArthur + Marcus Shawcroft + Nigel Stephens + Ramana Radhakrishnan + Richard Earnshaw + Sofiane Naci + Tejas Belagod + Yufeng Zhang * readelf.c (guess_is_rela): Handle EM_AARCH64. (get_machine_name): Likewise. @@ -88,17 +93,17 @@ 2012-07-24 Teresa Johnson * addr2line.c (find_address_in_section): Invoke - bfd_find_nearest_line_discriminator to get the discriminator. + bfd_find_nearest_line_discriminator to get the discriminator. (find_offset_in_section): Likewise. (translate_addresses): Print discriminator if it is non-zero. * objdump.c (show_line): Invoke - bfd_find_nearest_line_discriminator to get the discriminator, - and keep track of prev_discriminator. Print discriminator - if it is non-zero. + bfd_find_nearest_line_discriminator to get the discriminator, + and keep track of prev_discriminator. Print discriminator + if it is non-zero. (disassemble_data): Initialize prev_discriminator. (dump_reloc_set): Invoke bfd_find_nearest_line_discriminator - to get the discriminator, and keep track of last_discriminator. - Print discriminator if it is non-zero. + to get the discriminator, and keep track of last_discriminator. + Print discriminator if it is non-zero. 2012-07-17 Nick Clifton @@ -360,8 +365,8 @@ 2012-04-11 Ryan Mansfield - * objdump.c (dump_bfd): If defaulting to dwarf call - dwarf_select_sections_all to enable displays. + * objdump.c (dump_bfd): If defaulting to dwarf call + dwarf_select_sections_all to enable displays. 2012-04-06 Roland McGrath 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; -- cgit v1.1