aboutsummaryrefslogtreecommitdiff
path: root/bfd/coff64-rs6000.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-12-15 22:10:27 +1030
committerAlan Modra <amodra@gmail.com>2020-12-16 15:17:53 +1030
commit342371d54cbbddf4342e1b261ad7c0941d7912d3 (patch)
tree4a04f06ce0a0f72dd55976679b28694d0570e9d2 /bfd/coff64-rs6000.c
parent61d2295d723c7d202f530ccca1eacb4cfedf06d9 (diff)
downloadgdb-342371d54cbbddf4342e1b261ad7c0941d7912d3.zip
gdb-342371d54cbbddf4342e1b261ad7c0941d7912d3.tar.gz
gdb-342371d54cbbddf4342e1b261ad7c0941d7912d3.tar.bz2
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.
Diffstat (limited to 'bfd/coff64-rs6000.c')
-rw-r--r--bfd/coff64-rs6000.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c
index 7185232..6b7cd34 100644
--- a/bfd/coff64-rs6000.c
+++ b/bfd/coff64-rs6000.c
@@ -177,11 +177,10 @@ static bfd_boolean xcoff64_bad_format_hook
(bfd *, void *);
/* Relocation functions */
-static bfd_boolean xcoff64_reloc_type_br
- (XCOFF_RELOC_FUNCTION_ARGS);
+static xcoff_reloc_function xcoff64_reloc_type_br;
-bfd_boolean (*xcoff64_calculate_relocation[XCOFF_MAX_CALCULATE_RELOCATION])
- (XCOFF_RELOC_FUNCTION_ARGS) =
+xcoff_reloc_function *const
+xcoff64_calculate_relocation[XCOFF_MAX_CALCULATE_RELOCATION] =
{
xcoff_reloc_type_pos, /* R_POS (0x00) */
xcoff_reloc_type_neg, /* R_NEG (0x01) */
@@ -2539,7 +2538,7 @@ HOWTO (0, /* type */
MINUS_ONE, /* dst_mask */
FALSE); /* pcrel_offset */
-static unsigned long xcoff64_glink_code[10] =
+static const unsigned long xcoff64_glink_code[10] =
{
0xe9820000, /* ld r12,0(r2) */
0xf8410028, /* std r2,40(r1) */