diff options
author | Nick Clifton <nickc@redhat.com> | 2013-07-19 10:44:01 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2013-07-19 10:44:01 +0000 |
commit | 1ae40aa4dfc6ae7e46e1680f7d7af7b04259f83d (patch) | |
tree | 7b924d6f1049d68e2c1ffcb90dab03d562818a8d /binutils | |
parent | * ldgram.y: Add ALIGN_WITH_INPUT output section attribute. (diff) | |
download | binutils-gdb-1ae40aa4dfc6ae7e46e1680f7d7af7b04259f83d.tar.gz binutils-gdb-1ae40aa4dfc6ae7e46e1680f7d7af7b04259f83d.tar.bz2 binutils-gdb-1ae40aa4dfc6ae7e46e1680f7d7af7b04259f83d.zip |
PR binutils/15745
* readelf.c (get_unwind_section_word): Whilst searching for a
reloc section associated with an unwind section, check the type as
well as the section number.
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/ChangeLog | 7 | ||||
-rw-r--r-- | binutils/readelf.c | 13 |
2 files changed, 13 insertions, 7 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 8f0451ae079..a6b0151a702 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,10 @@ +2013-07-19 Nick Clifton <nickc@redhat.com> + + PR binutils/15745 + * readelf.c (get_unwind_section_word): Whilst searching for a + reloc section associated with an unwind section, check the type as + well as the section number. + 2013-07-18 Jim Thomas <thomas@cfht.hawaii.edu> * ar.c (usage): Fix C conformance issue. diff --git a/binutils/readelf.c b/binutils/readelf.c index c4a59821410..b6c2a39cc30 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -6623,7 +6623,10 @@ get_unwind_section_word (struct arm_unw_aux_info * aux, ++relsec) { if (relsec->sh_info >= elf_header.e_shnum - || section_headers + relsec->sh_info != sec) + || section_headers + relsec->sh_info != sec + /* PR 15745: Check the section type as well. */ + || (relsec->sh_type != SHT_REL + && relsec->sh_type != SHT_RELA)) continue; arm_sec->rel_type = relsec->sh_type; @@ -6633,19 +6636,15 @@ get_unwind_section_word (struct arm_unw_aux_info * aux, relsec->sh_size, & arm_sec->rela, & arm_sec->nrelas)) return FALSE; - break; } - else if (relsec->sh_type == SHT_RELA) + else /* relsec->sh_type == SHT_RELA */ { if (!slurp_rela_relocs (aux->file, relsec->sh_offset, relsec->sh_size, & arm_sec->rela, & arm_sec->nrelas)) return FALSE; - break; } - else - warn (_("unexpected relocation type (%d) for section %d"), - relsec->sh_type, relsec->sh_info); + break; } arm_sec->next_rela = arm_sec->rela; |