diff options
author | Alan Modra <amodra@gmail.com> | 2014-04-16 11:47:13 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2014-04-16 11:50:30 +0930 |
commit | 40fd06d18832d52c9ab08914d8d5428ca68e5726 (patch) | |
tree | 2c317a5e7e047539e4dc6a53943148910144be6e /bfd | |
parent | 7d9ac5f946c94de300fb22962b53701d2b73c52d (diff) | |
download | gdb-40fd06d18832d52c9ab08914d8d5428ca68e5726.zip gdb-40fd06d18832d52c9ab08914d8d5428ca68e5726.tar.gz gdb-40fd06d18832d52c9ab08914d8d5428ca68e5726.tar.bz2 |
fill ppc476 fixup area
Stops false positive warnings from scanner.
* elf32-ppc.c (ppc_elf_relocate_section): Fill 476 fixup area
with "ba 0" rather than zeros.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elf32-ppc.c | 16 |
2 files changed, 19 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 55d4828..99285f3 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -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. diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 8492732..ae68b5d 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -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 |