]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
fill ppc476 fixup area
authorAlan Modra <amodra@gmail.com>
Wed, 16 Apr 2014 02:17:13 +0000 (11:47 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 16 Apr 2014 02:58:23 +0000 (12:28 +0930)
Stops false positive warnings from scanner.

* elf32-ppc.c (ppc_elf_relocate_section): Fill 476 fixup area
with "ba 0" rather than zeros.

bfd/ChangeLog
bfd/elf32-ppc.c

index bf705877e9d483108bab5d85f6ef22150ac1e095..aa1ec43cacbefa4b4c1cb6fb7f3af7712a76c5f1 100644 (file)
@@ -1,6 +1,10 @@
 2014-04-16  Alan Modra  <amodra@gmail.com>
 
        Apply mainline patches for ppc476 workaround
+       2014-04-16  Alan Modra  <amodra@gmail.com>
+       * elf32-ppc.c (ppc_elf_relocate_section): Fill 476 fixup area
+       with "ba 0" rather than zeros.
+
        2014-04-14  Alan Modra  <amodra@gmail.com>
        * elf32-ppc.c (BA): Define
        (ppc_elf_link_hash_table_create): Correct default_params.
index 43e77d8f299f165830bad3713f5ca441df446ed4..47ef46ad08046e7fd33f523510a571ca584d8c51 100644 (file)
@@ -9173,8 +9173,20 @@ ppc_elf_relocate_section (bfd *output_bfd,
 
       relax_info = elf_section_data (input_section)->sec_info;
       if (relax_info->workaround_size != 0)
-       memset (contents + input_section->size - relax_info->workaround_size,
-               0, relax_info->workaround_size);
+       {
+         bfd_byte *p;
+         unsigned int n;
+         bfd_byte fill[4];
+
+         bfd_put_32 (input_bfd, BA, fill);
+         p = contents + input_section->size - relax_info->workaround_size;
+         n = relax_info->workaround_size >> 2;
+         while (n--)
+           {
+             memcpy (p, fill, 4);
+             p += 4;
+           }
+       }
 
       /* The idea is: Replace the last instruction on a page with a
         branch to a patch area.  Put the insn there followed by a