]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Factor out common relocation processing
authorAlan Modra <amodra@gmail.com>
Sat, 11 Aug 2018 01:37:07 +0000 (11:07 +0930)
committerAlan Modra <amodra@gmail.com>
Sat, 11 Aug 2018 04:09:16 +0000 (13:39 +0930)
commit1dc9e2d63e37839ff1768346b2e3f52e338baba5
tree212b1b182e42e5ee2f4ddf5382a55c784b99bfad
parent7cf9ebc6958462c3ef1372071d1ced5dae7bef3c
Factor out common relocation processing

This patch factors out some code common to both bfd_perform_relocation
and bfd_install_relocation, in the process fixing the omission of
"case -1" in bfd_install_relocation.

* reloc.c (bfd_get_reloc_size): Sort switch.
(read_reloc, write_reloc, apply_reloc): New functions.
(bfd_perform_relocation, bfd_install_relocation): Use apply_reloc.
(_bfd_relocate_contents): Use read_reloc and write_reloc.
(_bfd_clear_contents): Likewise.
bfd/ChangeLog
bfd/reloc.c