]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PR ld/15382
authorAlan Modra <amodra@gmail.com>
Mon, 22 Apr 2013 15:03:01 +0000 (15:03 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 22 Apr 2013 15:03:01 +0000 (15:03 +0000)
* elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Don't multiply
sh_size or reloc_count adjustment by count.

bfd/ChangeLog
bfd/elf-bfd.h

index c8d5619d7fc85597771f49a8720c88dd47e1a0bf..0c62889362bf7e5854d93b5703707c28bfb22a01 100644 (file)
@@ -1,3 +1,9 @@
+2013-04-22  Alan Modra  <amodra@gmail.com>
+
+       PR ld/15382
+       * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Don't multiply
+       sh_size or reloc_count adjustment by count.
+
 2013-04-22  Alan Modra  <amodra@gmail.com>
 
        * elf64-ppc.c (ppc64_elf_check_relocs): Don't call
index 3b4bd6f989491b62305b533f6b1019f2b830b3c0..b643dbc8a80d4d9bfd32eb5a8d44192642080ab5 100644 (file)
@@ -2497,16 +2497,16 @@ extern asection _bfd_elf_large_com_section;
        rel_hdr = _bfd_elf_single_rel_hdr (input_section->output_section); \
                                                                        \
        /* Avoid empty output section.  */                              \
-       if (rel_hdr->sh_size > count * rel_hdr->sh_entsize)             \
+       if (rel_hdr->sh_size > rel_hdr->sh_entsize)                     \
          {                                                             \
-           rel_hdr->sh_size -= count * rel_hdr->sh_entsize;            \
+           rel_hdr->sh_size -= rel_hdr->sh_entsize;                    \
            rel_hdr = _bfd_elf_single_rel_hdr (input_section);          \
-           rel_hdr->sh_size -= count * rel_hdr->sh_entsize;            \
+           rel_hdr->sh_size -= rel_hdr->sh_entsize;                    \
                                                                        \
            memmove (rel, rel + count,                                  \
                     (relend - rel - count) * sizeof (*rel));           \
                                                                        \
-           input_section->reloc_count -= count;                        \
+           input_section->reloc_count--;                               \
            relend -= count;                                            \
            rel--;                                                      \
            continue;                                                   \