PR binutils/15745
authorNick Clifton <nickc@redhat.com>
Fri, 19 Jul 2013 10:44:01 +0000 (10:44 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 19 Jul 2013 10:44:01 +0000 (10:44 +0000)
* 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.

binutils/ChangeLog
binutils/readelf.c

index 8f0451ae07923b1f907440903db0181680c70ba5..a6b0151a702cd28b505cd26d804977a9743275b1 100644 (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>
 
        * ar.c (usage): Fix C conformance issue.
index c4a59821410524dd5491f124230cb2898a922635..b6c2a39cc3010938c26761ca70e128d96dd6c09f 100644 (file)
@@ -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;
This page took 0.035107 seconds and 4 git commands to generate.