ppc: sanity check writing relocs
authorAlan Modra <amodra@gmail.com>
Fri, 4 Aug 2023 08:07:12 +0000 (17:37 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 4 Aug 2023 08:29:01 +0000 (17:59 +0930)
commit066c738ec5d803a080e3da3b0936484a10c8f31b
treef3d9ca479fb81e84da8e3fdcc060fc3d3be50d2b
parentae33771224660dac25e64c3f70943a17bfab7681
ppc: sanity check writing relocs

Check for output buffer overruns.

* elf32-ppc.c (swap_reloc_out, count_and_swap_reloc_out): New
functions.  Use throughout file.
* elf64-ppc.c (swap_reloc_out, count_and_swap_reloc_out): Likewise.
bfd/elf32-ppc.c
bfd/elf64-ppc.c