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.
This commit is contained in:
Nick Clifton 2013-07-19 10:44:01 +00:00
parent 1eec346e12
commit 1ae40aa4df
2 changed files with 13 additions and 7 deletions

View file

@ -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> 2013-07-18 Jim Thomas <thomas@cfht.hawaii.edu>
* ar.c (usage): Fix C conformance issue. * ar.c (usage): Fix C conformance issue.

View file

@ -6623,7 +6623,10 @@ get_unwind_section_word (struct arm_unw_aux_info * aux,
++relsec) ++relsec)
{ {
if (relsec->sh_info >= elf_header.e_shnum 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; continue;
arm_sec->rel_type = relsec->sh_type; arm_sec->rel_type = relsec->sh_type;
@ -6633,19 +6636,15 @@ get_unwind_section_word (struct arm_unw_aux_info * aux,
relsec->sh_size, relsec->sh_size,
& arm_sec->rela, & arm_sec->nrelas)) & arm_sec->rela, & arm_sec->nrelas))
return FALSE; 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, if (!slurp_rela_relocs (aux->file, relsec->sh_offset,
relsec->sh_size, relsec->sh_size,
& arm_sec->rela, & arm_sec->nrelas)) & arm_sec->rela, & arm_sec->nrelas))
return FALSE; return FALSE;
break;
} }
else break;
warn (_("unexpected relocation type (%d) for section %d"),
relsec->sh_type, relsec->sh_info);
} }
arm_sec->next_rela = arm_sec->rela; arm_sec->next_rela = arm_sec->rela;