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:20:30 +0000 (11:50 +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 55d4828cc6a8866b83cf9b54c847c065af958b93..99285f3a605386e1e6ad92f54aee80b9b9477f36 100644 (file)
@@ -1,3 +1,8 @@
+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-15  Marcus Shawcroft  <marcus.shawcroft@arm.com>
 
        * (elfNN_aarch64_tls_relax): Fix instruction mask.
index 8492732d9e37f5a154a37a8a38db98fb4ce3526c..ae68b5de206ec318656573eb3ccc810ecb1f5f1e 100644 (file)
@@ -9225,8 +9225,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
This page took 0.029317 seconds and 4 git commands to generate.