* elf32-h8300.c (elf32_h8_relax_section): When checking for a
authorNick Clifton <nickc@redhat.com>
Fri, 25 Jan 2013 14:22:10 +0000 (14:22 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 25 Jan 2013 14:22:10 +0000 (14:22 +0000)
second reloc, make sure that the reloc potentially exists first.

bfd/ChangeLog
bfd/elf32-h8300.c

index 6dfcb64..e36a37c 100644 (file)
@@ -1,3 +1,8 @@
+2013-01-25  Michael Schewe  <michael.schewe@gmx.net>
+
+       * elf32-h8300.c (elf32_h8_relax_section): When checking for a
+       second reloc, make sure that the reloc potentially exists first.
+
 2013-01-24  Nick Clifton  <nickc@redhat.com>
 
        * archures.c: Add bfd_mach_v850e3v5.
index 388d220..43ac16e 100644 (file)
@@ -1239,7 +1239,7 @@ elf32_h8_relax_section (bfd *abfd, asection *sec,
                            second_reloc = 1;
                          }
                      }
-                   if (irel < irelend)
+                   if (irel + 1 < irelend)
                      {
                        Elf_Internal_Rela *next_reloc = irel + 1;
                        arelent bfd_reloc;