+2020-12-18 Alan Modra <amodra@gmail.com>
+
+ * coff-z80.c (bfd_howto_type): Make typedef const.
+ * elf32-z80.c (bfd_howto_type): Likewise.
+ * elf32-m32c.c (EncodingTable): Likewise.
+ * elf32-csky.c (csky_arch_for_merge): Likewise.
+ (csky_archs): Use typedef.
+ * elf32-m68hc11.c (m68hc11_direct_relax_table): Make const.
+ (find_relaxable_insn, m68hc11_elf_relax_section): Adjust to suit.
+ * elf32-ppc.c (ppc_alt_plt): Make const.
+ * elf32-rl78.c (relax_addr16): Likewise.
+ * targets.c (_bfd_associated_vector): Likewise.
+ (bfd_target_vector, bfd_associated_vector): Likewise.
+ * libbfd-in.h (bfd_target_vector, bfd_associated_vector): Likewise.
+ * libbfd.h: Regenerate.
+
2020-12-18 Alan Modra <amodra@gmail.com>
* ecoff.c (bfd_debug_section): Init using BFD_FAKE_SECTION.
#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER 0
-typedef struct {
+typedef const struct {
bfd_reloc_code_real_type r_type;
reloc_howto_type howto;
} bfd_howto_type;
CSKY_V2
};
-typedef struct csky_arch_for_merge
+typedef const struct csky_arch_for_merge
{
const char *name;
const unsigned long arch_eflag;
unsigned int do_warning;
} csky_arch_for_merge;
-static struct csky_arch_for_merge csky_archs[] =
+static csky_arch_for_merge csky_archs[] =
{
/* 510 and 610 merge to 610 without warning. */
{ "ck510", CSKY_ARCH_510, CSKY_V1, 0, 0},
/* If the displacement is within the given range and the new encoding
differs from the old encoding (the index), then the insn can be
relaxed to the new encoding. */
-typedef struct {
+typedef const struct {
int bytes;
unsigned int max_disp;
unsigned char new_encoding;
\f
/* 68HC11 Linker Relaxation. */
-struct m68hc11_direct_relax
+const struct m68hc11_direct_relax
{
const char *name;
unsigned char code;
{ 0, 0, 0 }
};
-static struct m68hc11_direct_relax *
+static const struct m68hc11_direct_relax *
find_relaxable_insn (unsigned char code)
{
int i;
{
unsigned char code;
unsigned short offset;
- struct m68hc11_direct_relax *rinfo;
+ const struct m68hc11_direct_relax *rinfo;
prev_insn_branch = 0;
offset = bfd_get_16 (abfd, contents + irel->r_offset);
};
/* This is what we want for new plt/got. */
-static struct bfd_elf_special_section ppc_alt_plt =
+static const struct bfd_elf_special_section ppc_alt_plt =
{ STRING_COMMA_LEN (".plt"), 0, SHT_PROGBITS, SHF_ALLOC };
static const struct bfd_elf_special_section *
}
}
-struct {
+const struct {
int prefix; /* or -1 for "no prefix" */
int insn; /* or -1 for "end of list" */
int insn_for_saddr; /* or -1 for "no alternative" */
/* All users of this file have bfd_octets_per_byte (abfd, sec) == 1. */
#define OCTETS_PER_BYTE(ABFD, SEC) 1
-typedef struct {
+typedef const struct {
bfd_reloc_code_real_type r_type;
reloc_howto_type howto;
} bfd_howto_type;
/* List of supported target vectors, and the default vector (if
bfd_default_vector[0] is NULL, there is no default). */
-extern const bfd_target * const *bfd_target_vector ATTRIBUTE_HIDDEN;
+extern const bfd_target *const *const bfd_target_vector ATTRIBUTE_HIDDEN;
extern const bfd_target *bfd_default_vector[] ATTRIBUTE_HIDDEN;
/* List of associated target vectors. */
-extern const bfd_target * const *bfd_associated_vector ATTRIBUTE_HIDDEN;
+extern const bfd_target *const *const bfd_associated_vector ATTRIBUTE_HIDDEN;
/* Functions shared by the ECOFF and MIPS ELF backends, which have no
other common header files. */
/* List of supported target vectors, and the default vector (if
bfd_default_vector[0] is NULL, there is no default). */
-extern const bfd_target * const *bfd_target_vector ATTRIBUTE_HIDDEN;
+extern const bfd_target *const *const bfd_target_vector ATTRIBUTE_HIDDEN;
extern const bfd_target *bfd_default_vector[] ATTRIBUTE_HIDDEN;
/* List of associated target vectors. */
-extern const bfd_target * const *bfd_associated_vector ATTRIBUTE_HIDDEN;
+extern const bfd_target *const *const bfd_associated_vector ATTRIBUTE_HIDDEN;
/* Functions shared by the ECOFF and MIPS ELF backends, which have no
other common header files. */
NULL /* end of list marker */
};
-const bfd_target * const *bfd_target_vector = _bfd_target_vector;
+const bfd_target *const *const bfd_target_vector = _bfd_target_vector;
/* bfd_default_vector[0] contains either the address of the default vector,
if there is one, or zero if there isn't. */
/* bfd_associated_vector[] contains the associated target vectors used
to reduce the ambiguity in bfd_check_format_matches. */
-static const bfd_target *_bfd_associated_vector[] = {
+static const bfd_target *const _bfd_associated_vector[] = {
#ifdef ASSOCIATED_VECS
ASSOCIATED_VECS,
#endif
NULL
};
-const bfd_target * const *bfd_associated_vector = _bfd_associated_vector;
+const bfd_target *const *const bfd_associated_vector = _bfd_associated_vector;
/* When there is an ambiguous match, bfd_check_format_matches puts the
names of the matching targets in an array. This variable is the maximum
+2020-12-18 Alan Modra <amodra@gmail.com>
+
+ * opcode/arc-attrs.h (CONFLICT_LIST): Make const.
+
2020-12-16 Alan Modra <amodra@gmail.com>
* bfdlink.h (struct bfd_link_info): Add maxpagesize and
#endif
/* A table with conflicting features. */
-unsigned CONFLICT_LIST [] = {
+const unsigned CONFLICT_LIST [] = {
NPS400 | SPX,
NPS400 | DPX,
DPX | DPA,