PR ld/6019
authorNick Clifton <nickc@redhat.com>
Wed, 4 Jun 2008 09:59:08 +0000 (09:59 +0000)
committerNick Clifton <nickc@redhat.com>
Wed, 4 Jun 2008 09:59:08 +0000 (09:59 +0000)
        * elf32-avr.c (elf32_avr_relax_section): Handle the case where
        there are no local symbols.

bfd/ChangeLog
bfd/elf32-avr.c

index ce9a20c..8b315a3 100644 (file)
@@ -1,3 +1,9 @@
+2008-06-04  Nick Clifton  <nickc@redhat.com>
+
+       PR ld/6019
+       * elf32-avr.c (elf32_avr_relax_section): Handle the case where
+       there are no local symbols.
+
 2008-06-04  Alan Modra  <amodra@bigpond.net.au>
 
        * elf32-spu.c (get_sym_h): Don't attempt to read global syms.
index 3cbfb75..ee2afab 100644 (file)
@@ -2034,7 +2034,8 @@ elf32_avr_relax_section (bfd *abfd,
                         /* Check for local symbols.  */
                         isym = (Elf_Internal_Sym *) symtab_hdr->contents;
                         isymend = isym + symtab_hdr->sh_info;
-                        for (; isym < isymend; isym++)
+                       /* PR 6019: There may not be any local symbols.  */
+                        for (; isym != NULL && isym < isymend; isym++)
                          {
                            if (isym->st_value == section_offset_of_ret_insn
                                && isym->st_shndx == sec_shndx)