PR ld/14902
authorNick Clifton <nickc@redhat.com>
Fri, 22 Mar 2013 15:53:36 +0000 (15:53 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 22 Mar 2013 15:53:36 +0000 (15:53 +0000)
* elf32-h8300.c (elf32_h8_relax_delete_bytes): Fix off by one
errors adjusting relocs and symbols.

bfd/ChangeLog
bfd/elf32-h8300.c

index 8439b55c656b89137c78507057ef36c075cf11d4..cef68c6f627b7d1b1e44ca08aeb6401f8963f5ec 100644 (file)
@@ -1,3 +1,9 @@
+2013-03-22  Achille Fouilleul  <achille.fouilleul+binutils@gadz.org>
+
+       PR ld/14902
+       * elf32-h8300.c (elf32_h8_relax_delete_bytes): Fix off by one
+       errors adjusting relocs and symbols.
+
 2013-03-21  Michael Schewe  <michael.schewe@gmx.net>
 
        * elf32-h8300 (h8_relax_section): Add new relaxation of mov
index 4cfc30e3ada6129e896c1f49e5899eed32c95a79..67bca3f57375bdeac432f8a5241b532f1e975e47 100644 (file)
@@ -1518,7 +1518,7 @@ elf32_h8_relax_delete_bytes (bfd *abfd, asection *sec, bfd_vma addr, int count)
     {
       /* Get the new reloc address.  */
       if ((irel->r_offset > addr
-          && irel->r_offset < toaddr))
+          && irel->r_offset <= toaddr))
        irel->r_offset -= count;
     }
 
@@ -1530,7 +1530,7 @@ elf32_h8_relax_delete_bytes (bfd *abfd, asection *sec, bfd_vma addr, int count)
     {
       if (isym->st_shndx == sec_shndx
          && isym->st_value > addr
-         && isym->st_value < toaddr)
+         && isym->st_value <= toaddr)
        isym->st_value -= count;
     }
 
@@ -1542,14 +1542,13 @@ elf32_h8_relax_delete_bytes (bfd *abfd, asection *sec, bfd_vma addr, int count)
   for (; sym_hashes < end_hashes; sym_hashes++)
     {
       struct elf_link_hash_entry *sym_hash = *sym_hashes;
+
       if ((sym_hash->root.type == bfd_link_hash_defined
           || sym_hash->root.type == bfd_link_hash_defweak)
          && sym_hash->root.u.def.section == sec
          && sym_hash->root.u.def.value > addr
-         && sym_hash->root.u.def.value < toaddr)
-       {
-         sym_hash->root.u.def.value -= count;
-       }
+         && sym_hash->root.u.def.value <= toaddr)
+       sym_hash->root.u.def.value -= count;
     }
 
   return TRUE;
This page took 0.035967 seconds and 4 git commands to generate.