XCOFF constify
authorAlan Modra <amodra@gmail.com>
Tue, 15 Dec 2020 11:40:27 +0000 (22:10 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 16 Dec 2020 04:47:53 +0000 (15:17 +1030)
commit342371d54cbbddf4342e1b261ad7c0941d7912d3
tree4a04f06ce0a0f72dd55976679b28694d0570e9d2
parent61d2295d723c7d202f530ccca1eacb4cfedf06d9
XCOFF constify

There are occasions where it is reasonable to use a macro defining
function parameters, but this isn't one of them.  Use typedefs
instead, which also simplifies declaring a const array of function
pointers.

* libxcoff.h (struct xcoff_backend_data_rec): Constify
_xcoff_glink_code.
(XCOFF_RELOC_FUNCTION_ARGS, XCOFF_COMPLAIN_FUNCTION_ARGS): Delete.
(xcoff_reloc_function, xcoff_complain_function): New typedef.
(xcoff_calculate_relocation, xcoff_complain_overflow),
(xcoff_reloc_type_noop, xcoff_reloc_type_fail),
(xcoff_reloc_type_pos, xcoff_reloc_type_neg),
(xcoff_reloc_type_rel, xcoff_reloc_type_toc),
(xcoff_reloc_type_ba, xcoff_reloc_type_crel): Update declaration.
* coff-rs6000.c (xcoff_reloc_type_br): Declare using typedef.
(xcoff_complain_overflow_dont_func): Likewise.
(xcoff_complain_overflow_bitfield_func): Likewise.
(xcoff_complain_overflow_signed_func): Likewise.
(xcoff_complain_overflow_unsigned_func): Likewise.
(xcoff_calculate_relocation, xcoff_complain_overflow): Constify.
(xcoff_glink_code): Constify.
* coff64-rs6000.c (xcoff64_reloc_type_br): Declare using typedef.
(xcoff64_calculate_relocation, xcoff64_glink_code): Constify.
bfd/ChangeLog
bfd/coff-rs6000.c
bfd/coff64-rs6000.c
bfd/libxcoff.h