bfd/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 20 Apr 2011 08:51:56 +0000 (08:51 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 20 Apr 2011 08:51:56 +0000 (08:51 +0000)
* elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Fix +1 overrun of
memmove elements.

bfd/ChangeLog
bfd/elf-bfd.h

index 5a15a6c28339bdea5fdf479a72f907bbdc9af713..fec3d20fe1c72c5dd65ecd0bbba338a83830fdd7 100644 (file)
@@ -1,3 +1,8 @@
+2011-04-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Fix +1 overrun of
+       memmove elements.
+
 2011-04-20  Alan Modra  <amodra@gmail.com>
 
        * libbfd.c (bfd_log2): Do return rounded up value.
index 39c7de6cb79d87d3bebc03838f70bec6a4a80261..735d2b58e4ee4edc40a185b820b7d0b6453dce11 100644 (file)
@@ -2405,7 +2405,7 @@ extern asection _bfd_elf_large_com_section;
            rel_hdr = _bfd_elf_single_rel_hdr (input_section);          \
            rel_hdr->sh_size -= rel_hdr->sh_entsize;                    \
                                                                        \
-           memmove (rel, rel + 1, (relend - rel) * sizeof (*rel));     \
+           memmove (rel, rel + 1, (relend - rel - 1) * sizeof (*rel)); \
                                                                        \
            input_section->reloc_count--;                               \
            relend--;                                                   \