* as.c (select_emulation_mode): Add const qualifiers.
* as.h: Likewise.
* config/bfin-defs.h: Likewise.
* config/bfin-parse.y: Likewise.
* config/rx-parse.y: Likewise.
* config/tc-aarch64.c (struct aarch64_option_table): Likewise.
(struct aarch64_cpu_option_table): Likewise.
(struct aarch64_arch_option_table): Likewise.
(struct aarch64_option_cpu_value_table): Likewise.
(struct aarch64_long_option_table): Likewise.
(struct aarch64_option_abi_value_table): Likewise.
* config/tc-arm.c (struct reloc_entry): Likewise.
(tc_gen_reloc): Likewise.
(struct arm_option_table): Likewise.
(struct arm_legacy_option_table): Likewise.
(struct arm_cpu_option_table): Likewise.
(struct arm_arch_option_table): Likewise.
(struct arm_option_extension_value_table): Likewise.
(struct arm_option_fpu_value_table): Likewise.
(struct arm_option_value_table): Likewise.
(struct arm_long_option_table): Likewise.
* config/tc-avr.c (struct avr_opcodes_s): Likewise.
(struct mcu_type_s): Likewise.
(struct exp_mod_s): Likewise.
(avr_operand): Likewise.
(avr_operands): Likewise.
* config/tc-d10v.c (md_begin): Likewise.
* config/tc-dlx.c: Likewise.
* config/tc-fr30.c (fr30_is_colon_insn): Likewise.
* config/tc-ft32.c (parse_condition): Likewise.
* config/tc-h8300.c (do_a_fix_imm): Likewise.
* config/tc-hppa.c (pa_ip): Likewise.
(hppa_regname_to_dw2regnum): Likewise.
* config/tc-i370.c (i370_elf_suffix): Likewise.
* config/tc-i960.c (struct tabentry): Likewise.
* config/tc-m32r.c: Likewise.
* config/tc-m68k.c: Likewise.
* config/tc-m68k.h: Likewise.
* config/tc-mcore.c (parse_psrmod): Likewise.
* config/tc-metag.c (struct metag_core_option): Likewise.
(struct metag_long_option): Likewise.
* config/tc-microblaze.c: Likewise.
* config/tc-mips.c (macro): Likewise.
* config/tc-mn10200.c: Likewise.
* config/tc-mn10300.c: Likewise.
* config/tc-msp430.c (struct rcodes_s): Likewise.
(struct hcodes_s): Likewise.
(md_parse_option): Likewise.
* config/tc-ns32k.c (struct ns32k_option): Likewise.
(optlist): Likewise.
* config/tc-ppc.c (ppc_elf_suffix): Likewise.
(tc_ppc_regname_to_dw2regnum): Likewise.
* config/tc-ppc.h: Likewise.
* config/tc-rl78.c: Likewise.
* config/tc-rx.c (struct cpu_type): Likewise.
* config/tc-sh.c (sh_regname_to_dw2regnum): Likewise.
* config/tc-sparc.c (struct priv_reg_entry): Likewise.
(sparc_ip): Likewise.
* config/tc-spu.c (insn_fmt_string): Likewise.
* config/tc-tic54x.c (tic54x_set_default_include): Likewise.
* config/tc-v850.c: Likewise.
* config/tc-visium.c (struct visium_arch_option_table): Likewise.
(struct visium_long_option_table): Likewise.
* config/tc-xgate.c: Likewise.
* config/tc-z8k.c: Likewise.
* read.c (add_include_dir): Likewise.
* read.h: Likewise.
+2016-02-25 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
+
+ * as.c (select_emulation_mode): Add const qualifiers.
+ * as.h: Likewise.
+ * config/bfin-defs.h: Likewise.
+ * config/bfin-parse.y: Likewise.
+ * config/rx-parse.y: Likewise.
+ * config/tc-aarch64.c (struct aarch64_option_table): Likewise.
+ (struct aarch64_cpu_option_table): Likewise.
+ (struct aarch64_arch_option_table): Likewise.
+ (struct aarch64_option_cpu_value_table): Likewise.
+ (struct aarch64_long_option_table): Likewise.
+ (struct aarch64_option_abi_value_table): Likewise.
+ * config/tc-arm.c (struct reloc_entry): Likewise.
+ (tc_gen_reloc): Likewise.
+ (struct arm_option_table): Likewise.
+ (struct arm_legacy_option_table): Likewise.
+ (struct arm_cpu_option_table): Likewise.
+ (struct arm_arch_option_table): Likewise.
+ (struct arm_option_extension_value_table): Likewise.
+ (struct arm_option_fpu_value_table): Likewise.
+ (struct arm_option_value_table): Likewise.
+ (struct arm_long_option_table): Likewise.
+ * config/tc-avr.c (struct avr_opcodes_s): Likewise.
+ (struct mcu_type_s): Likewise.
+ (struct exp_mod_s): Likewise.
+ (avr_operand): Likewise.
+ (avr_operands): Likewise.
+ * config/tc-d10v.c (md_begin): Likewise.
+ * config/tc-dlx.c: Likewise.
+ * config/tc-fr30.c (fr30_is_colon_insn): Likewise.
+ * config/tc-ft32.c (parse_condition): Likewise.
+ * config/tc-h8300.c (do_a_fix_imm): Likewise.
+ * config/tc-hppa.c (pa_ip): Likewise.
+ (hppa_regname_to_dw2regnum): Likewise.
+ * config/tc-i370.c (i370_elf_suffix): Likewise.
+ * config/tc-i960.c (struct tabentry): Likewise.
+ * config/tc-m32r.c: Likewise.
+ * config/tc-m68k.c: Likewise.
+ * config/tc-m68k.h: Likewise.
+ * config/tc-mcore.c (parse_psrmod): Likewise.
+ * config/tc-metag.c (struct metag_core_option): Likewise.
+ (struct metag_long_option): Likewise.
+ * config/tc-microblaze.c: Likewise.
+ * config/tc-mips.c (macro): Likewise.
+ * config/tc-mn10200.c: Likewise.
+ * config/tc-mn10300.c: Likewise.
+ * config/tc-msp430.c (struct rcodes_s): Likewise.
+ (struct hcodes_s): Likewise.
+ (md_parse_option): Likewise.
+ * config/tc-ns32k.c (struct ns32k_option): Likewise.
+ (optlist): Likewise.
+ * config/tc-ppc.c (ppc_elf_suffix): Likewise.
+ (tc_ppc_regname_to_dw2regnum): Likewise.
+ * config/tc-ppc.h: Likewise.
+ * config/tc-rl78.c: Likewise.
+ * config/tc-rx.c (struct cpu_type): Likewise.
+ * config/tc-sh.c (sh_regname_to_dw2regnum): Likewise.
+ * config/tc-sparc.c (struct priv_reg_entry): Likewise.
+ (sparc_ip): Likewise.
+ * config/tc-spu.c (insn_fmt_string): Likewise.
+ * config/tc-tic54x.c (tic54x_set_default_include): Likewise.
+ * config/tc-v850.c: Likewise.
+ * config/tc-visium.c (struct visium_arch_option_table): Likewise.
+ (struct visium_long_option_table): Likewise.
+ * config/tc-xgate.c: Likewise.
+ * config/tc-z8k.c: Likewise.
+ * read.c (add_include_dir): Likewise.
+ * read.h: Likewise.
+
2016-02-25 Andrew Burgess <andrew.burgess@embecosm.com>
* testsuite/gas/all/gas.exp: Change target pattern to cover
select_emulation_mode (int argc, char **argv)
{
int i;
- char *p, *em = 0;
+ char *p;
+ const char *em = NULL;
for (i = 1; i < argc; i++)
if (!strncmp ("--em", argv[i], 4))
#ifdef USE_EMULATIONS
{
int i;
- char *def_em;
+ const char *def_em;
fprintf (stream, "\
--em=[");
COMMON int flag_noexecstack;
/* name of emitted object file */
-COMMON char *out_file_name;
+COMMON const char *out_file_name;
/* name of file defining extensions to the basic instruction set */
COMMON char *insttbl_file_name;
extern int debug_codeselection;
-void error (char *format, ...);
+void error (const char *format, ...);
void warn (char *format, ...);
int semantic_error (char *syntax);
void semantic_error_2 (char *syntax);
static Expr_Node *binary (Expr_Op_Type, Expr_Node *, Expr_Node *);
static Expr_Node *unary (Expr_Op_Type, Expr_Node *);
-static void notethat (char *, ...);
+static void notethat (const char *, ...);
char *current_inputline;
extern char *yytext;
-int yyerror (char *);
+int yyerror (const char *);
/* Used to set SRCx fields to all 1s as described in the PRM. */
static Register reg7 = {REG_R7, 0};
-void error (char *format, ...)
+void error (const char *format, ...)
{
va_list ap;
static char buffer[2000];
}
int
-yyerror (char *msg)
+yyerror (const char *msg)
{
if (msg[0] == '\0')
error ("%s", msg);
int debug_codeselection = 0;
static void
-notethat (char *format, ...)
+notethat (const char *format, ...)
{
va_list ap;
va_start (ap, format);
static struct
{
- char * string;
+ const char * string;
int token;
}
condition_opcode_table[] =
static struct
{
- char * string;
+ const char * string;
int val;
}
condition_table[] =
}
static int
-check_condition (char * base)
+check_condition (const char * base)
{
char * cp;
unsigned int i;
struct aarch64_option_table
{
- char *option; /* Option name to match. */
- char *help; /* Help information. */
+ const char *option; /* Option name to match. */
+ const char *help; /* Help information. */
int *var; /* Variable to change. */
int value; /* What to change it to. */
char *deprecated; /* If non-null, print this message. */
struct aarch64_cpu_option_table
{
- char *name;
+ const char *name;
const aarch64_feature_set value;
/* The canonical name of the CPU, or NULL to use NAME converted to upper
case. */
struct aarch64_arch_option_table
{
- char *name;
+ const char *name;
const aarch64_feature_set value;
};
/* ISA extensions. */
struct aarch64_option_cpu_value_table
{
- char *name;
+ const char *name;
const aarch64_feature_set value;
};
struct aarch64_long_option_table
{
- char *option; /* Substring to match. */
- char *help; /* Help information. */
+ const char *option; /* Substring to match. */
+ const char *help; /* Help information. */
int (*func) (char *subopt); /* Function to decode sub-option. */
char *deprecated; /* If non-null, print this message. */
};
/* ABIs. */
struct aarch64_option_abi_value_table
{
- char *name;
+ const char *name;
enum aarch64_abi_type value;
};
struct reloc_entry
{
- char * name;
+ const char * name;
bfd_reloc_code_real_type reloc;
};
default:
{
- char * type;
+ const char * type;
switch (fixp->fx_r_type)
{
struct arm_option_table
{
- char *option; /* Option name to match. */
- char *help; /* Help information. */
+ const char *option; /* Option name to match. */
+ const char *help; /* Help information. */
int *var; /* Variable to change. */
int value; /* What to change it to. */
- char *deprecated; /* If non-null, print this message. */
+ const char *deprecated; /* If non-null, print this message. */
};
struct arm_option_table arm_opts[] =
struct arm_legacy_option_table
{
- char *option; /* Option name to match. */
+ const char *option; /* Option name to match. */
const arm_feature_set **var; /* Variable to change. */
const arm_feature_set value; /* What to change it to. */
- char *deprecated; /* If non-null, print this message. */
+ const char *deprecated; /* If non-null, print this message. */
};
const struct arm_legacy_option_table arm_legacy_opts[] =
struct arm_cpu_option_table
{
- char *name;
+ const char *name;
size_t name_len;
const arm_feature_set value;
/* For some CPUs we assume an FPU unless the user explicitly sets
struct arm_arch_option_table
{
- char *name;
+ const char *name;
size_t name_len;
const arm_feature_set value;
const arm_feature_set default_fpu;
/* ISA extensions in the co-processor and main instruction set space. */
struct arm_option_extension_value_table
{
- char *name;
+ const char *name;
size_t name_len;
const arm_feature_set merge_value;
const arm_feature_set clear_value;
/* ISA floating-point and Advanced SIMD extensions. */
struct arm_option_fpu_value_table
{
- char *name;
+ const char *name;
const arm_feature_set value;
};
struct arm_option_value_table
{
- char *name;
+ const char *name;
long value;
};
struct arm_long_option_table
{
- char * option; /* Substring to match. */
- char * help; /* Help information. */
+ const char * option; /* Substring to match. */
+ const char * help; /* Help information. */
int (* func) (char * subopt); /* Function to decode sub-option. */
- char * deprecated; /* If non-null, print this message. */
+ const char * deprecated; /* If non-null, print this message. */
};
static bfd_boolean
struct avr_opcodes_s
{
- char * name;
- char * constraints;
- char * opcode;
+ const char * name;
+ const char * constraints;
+ const char * opcode;
int insn_size; /* In words. */
int isa;
unsigned int bin_opcode;
const char *md_shortopts = "m:";
struct mcu_type_s
{
- char *name;
+ const char *name;
int isa;
int mach;
};
struct exp_mod_s
{
- char * name;
+ const char * name;
bfd_reloc_code_real_type reloc;
bfd_reloc_code_real_type neg_reloc;
int have_pm;
static unsigned int
avr_operand (struct avr_opcodes_s *opcode,
int where,
- char *op,
+ const char *op,
char **line)
{
expressionS op_expr;
if (*str == '+')
{
++str;
- char *s;
+ const char *s;
for (s = opcode->opcode; *s; ++s)
{
if (*s == '+')
static unsigned int
avr_operands (struct avr_opcodes_s *opcode, char **line)
{
- char *op = opcode->constraints;
+ const char *op = opcode->constraints;
unsigned int bin = opcode->bin_opcode;
char *frag = frag_more (opcode->insn_size * 2);
char *str = *line;
void
md_begin (void)
{
- char *prev_name = "";
+ const char *prev_name = "";
struct d10v_opcode *opcode;
d10v_hash = hash_new ();
const char FLT_CHARS[] = "rRsSfFdDxXpP";
static void
-insert_sreg (char *regname, int regnum)
+insert_sreg (const char *regname, int regnum)
{
/* Must be large enough to hold the names of the special registers. */
char buf[80];
#define MAX_REG_NO 35
/* Currently we have 35 software registers defined -
we borrowed from MIPS. */
- static char *soft_reg[] =
+ static const char *soft_reg[] =
{
"zero", "at", "v0", "v1", "a0", "a1", "a2", "a3",
"t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9",
{
/* Yup - it might be delay slot instruction. */
int i;
- static char * delay_insns [] =
+ static const char * delay_insns [] =
{
"call", "jmp", "ret", "bra", "bno",
"beq", "bne", "bc", "bnc", "bn",
for (i = sizeof (delay_insns) / sizeof (delay_insns[0]); i--;)
{
- char * insn = delay_insns[i];
+ const char * insn = delay_insns[i];
int len = strlen (insn);
if (start [len] != 0)
{
char *s = *ptr;
static const struct {
- char *name;
+ const char *name;
int bits;
} ccs[] = {
{ "gt," , (2 << FT32_FLD_CR_BIT) | (5 << FT32_FLD_CB_BIT) | (1 << FT32_FLD_CV_BIT)},
static void fix_operand_size (struct h8_op *, int);
static void build_bytes (const struct h8_instruction *, struct h8_op *);
static void do_a_fix_imm (int, int, struct h8_op *, int, const struct h8_instruction *);
-static void check_operand (struct h8_op *, unsigned int, char *);
+static void check_operand (struct h8_op *, unsigned int, const char *);
static const struct h8_instruction * get_specific (const struct h8_instruction *, struct h8_op *, int) ;
static char *get_operands (unsigned, char *, struct h8_op *);
static void get_operand (char **, struct h8_op *, int);
}
static void
-check_operand (struct h8_op *operand, unsigned int width, char *string)
+check_operand (struct h8_op *operand, unsigned int width, const char *string)
{
if (operand->exp.X_add_symbol == 0
&& operand->exp.X_op_symbol == 0)
int where;
char *bytes = frag_now->fr_literal + offset;
- char *t = ((operand->mode & MODE) == IMM) ? "#" : "@";
+ const char *t = ((operand->mode & MODE) == IMM) ? "#" : "@";
if (operand->exp.X_add_symbol == 0)
{
struct pd_reg
{
- char *name;
+ const char *name;
int value;
};
to a condition number which can be recorded in an instruction. */
struct fp_cond_map
{
- char *string;
+ const char *string;
int cond;
};
string to a field selector type. */
struct selector_entry
{
- char *prefix;
+ const char *prefix;
int field_selector;
};
static void
pa_ip (char *str)
{
- char *error_message = "";
+ const char *error_message = "";
char *s, c, *argstart, *name, *save_s;
const char *args;
int match = FALSE;
unsigned int i;
const char *p;
char *q;
- static struct { char *name; int dw2regnum; } regnames[] =
+ static struct { const char *name; int dw2regnum; } regnames[] =
{
{ "sp", 30 }, { "rp", 2 },
};
/* Structure to hold information about predefined registers. */
struct pd_reg
{
- char *name;
+ const char *name;
int value;
};
{
struct map_bfd
{
- char *string;
+ const char *string;
int length;
bfd_reloc_code_real_type reloc;
};
operands. */
static const struct
{
- char *reg_name;
+ const char *reg_name;
int reg_num;
}
regnames[] =
'abase' (indirect addressing) registers. */
static const struct
{
- char *areg_name;
+ const char *areg_name;
int areg_num;
}
aregs[] =
static void
get_cdisp (char *dispP, /* Displacement as specified in source instruction. */
- char *ifmtP, /* "COBR" or "CTRL" (for use in error message). */
+ const char *ifmtP, /* "COBR" or "CTRL" (for use in error message). */
long instr, /* Instruction needing the displacement. */
int numbits, /* # bits of displacement (13 for COBR, 24 for CTRL). */
int var_frag,/* 1 if varying length code fragment should be emitted;
struct tabentry
{
- char *flag;
+ const char *flag;
int arch;
};
static const struct tabentry arch_tab[] =
}
inline static char *
-m32r_end_of_match (char *cont, char *what)
+m32r_end_of_match (char *cont, const char *what)
{
int len = strlen (what);
#endif
int
-tc_m68k_regname_to_dw2regnum (char *regname)
+tc_m68k_regname_to_dw2regnum (const char *regname)
{
unsigned int regnum;
static const char *const regnames[] =
#define DWARF2_CIE_DATA_ALIGNMENT (-4)
#define tc_regname_to_dw2regnum tc_m68k_regname_to_dw2regnum
-extern int tc_m68k_regname_to_dw2regnum (char *regname);
+extern int tc_m68k_regname_to_dw2regnum (const char *regname);
#define tc_cfi_frame_initial_instructions tc_m68k_frame_initial_instructions
extern void tc_m68k_frame_initial_instructions (void);
#define POOL_START_LABEL ".LS"
static void
-make_name (char * s, char * p, int n)
+make_name (char * s, const char * p, int n)
{
static const char hex[] = "0123456789ABCDEF";
md_begin (void)
{
const mcore_opcode_info * opcode;
- char * prev_name = "";
+ const char * prev_name = "";
opcode_hash_control = hash_new ();
static struct Cregs
{
- char * name;
+ const char * name;
unsigned int crnum;
}
cregs[] =
char buf[10];
static struct psrmods
{
- char * name;
+ const char * name;
unsigned int value;
}
psrmods[] =
struct metag_core_option
{
- char *name;
+ const char *name;
unsigned int value;
};
struct metag_long_option
{
- char * option; /* Substring to match. */
- char * help; /* Help information. */
+ const char * option; /* Substring to match. */
+ const char * help; /* Help information. */
int (* func) (char * subopt); /* Function to decode sub-option. */
- char * deprecated; /* If non-null, print this message. */
+ const char * deprecated; /* If non-null, print this message. */
};
struct metag_long_option metag_long_opts[] =
}
static char *
-metag_end_of_match (char * cont, char * what)
+metag_end_of_match (char * cont, const char * what)
{
int len = strlen (what);
#define IMM_MAX 9
struct imm_type {
- char *isuffix; /* Suffix String */
+ const char *isuffix; /* Suffix String */
int itype; /* Suffix Type */
int otype; /* Offset Type */
};
case M_DROL_I:
{
unsigned int rot;
- char *l;
- char *rr;
+ const char *l;
+ const char *rr;
rot = imm_expr.X_add_number & 0x3f;
if (ISA_HAS_DROR (mips_opts.isa) || CPU_HAS_DROR (mips_opts.arch))
case M_DROR_I:
{
unsigned int rot;
- char *l;
- char *rr;
+ const char *l;
+ const char *rr;
rot = imm_expr.X_add_number & 0x3f;
if (ISA_HAS_DROR (mips_opts.isa) || CPU_HAS_DROR (mips_opts.arch))
void
md_begin (void)
{
- char *prev_name = "";
+ const char *prev_name = "";
const struct mn10200_opcode *op;
mn10200_hash = hash_new ();
void
md_begin (void)
{
- char *prev_name = "";
+ const char *prev_name = "";
const struct mn10300_opcode *op;
mn10300_hash = hash_new ();
}
static inline char *
-mn10300_end_of_match (char *cont, char *what)
+mn10300_end_of_match (char *cont, const char *what)
{
int len = strlen (what);
struct rcodes_s
{
- char * name;
+ const char * name;
int index; /* Corresponding insn_opnumb. */
int sop; /* Opcode if jump length is short. */
long lpos; /* Label position. */
struct hcodes_s
{
- char * name;
+ const char * name;
int index; /* Corresponding insn_opnumb. */
int tlab; /* Number of labels in short mode. */
int op0; /* Opcode for first word of short jump. */
signed int i;
const struct
{
- char * name;
+ const char * name;
unsigned int length;
unsigned int bitfield;
} erratas[] =
/* Internal structs. */
struct ns32k_option
{
- char *pattern;
+ const char *pattern;
unsigned long or;
unsigned long and;
};
unsigned long *default_map) /* Default pattern and output. */
{
int i, j, k, strlen1, strlen2;
- char *patternP, *strP;
+ const char *patternP, *strP;
strlen1 = strlen (str);
/* Structure to hold information about predefined registers. */
struct pd_reg
{
- char *name;
+ const char *name;
int value;
};
return bfd_mach_ppc;
}
-extern char*
+extern const char*
ppc_target_format (void)
{
#ifdef OBJ_COFF
ppc_elf_suffix (char **str_p, expressionS *exp_p)
{
struct map_bfd {
- char *string;
+ const char *string;
unsigned int length : 8;
unsigned int valid32 : 1;
unsigned int valid64 : 1;
unsigned int i;
const char *p;
char *q;
- static struct { char *name; int dw2regnum; } regnames[] =
+ static struct { const char *name; int dw2regnum; } regnames[] =
{
{ "sp", 1 }, { "r.sp", 1 }, { "rtoc", 2 }, { "r.toc", 2 },
{ "mq", 64 }, { "lr", 65 }, { "ctr", 66 }, { "ap", 67 },
/* The target BFD format. */
#define TARGET_FORMAT (ppc_target_format ())
-extern char *ppc_target_format (void);
+extern const char *ppc_target_format (void);
/* Permit temporary numeric labels. */
#define LOCAL_LABELS_FB 1
}
static void
-require_end_of_expr (char *fname)
+require_end_of_expr (const char *fname)
{
while (* input_line_pointer == ' '
|| * input_line_pointer == '\t')
static struct
{
- char * fname;
+ const char * fname;
int reloc;
}
reloc_functions[] =
struct cpu_type
{
- char *cpu_name;
+ const char *cpu_name;
int type;
};
static struct
{
- char * fname;
+ const char * fname;
int reloc;
}
reloc_functions[] =
md_begin (void)
{
const sh_opcode_info *opcode;
- char *prev_name = "";
+ const char *prev_name = "";
unsigned int target_arch;
target_arch
#ifdef OBJ_ELF
inline static char *
-sh_end_of_match (char *cont, char *what)
+sh_end_of_match (char *cont, const char *what)
{
int len = strlen (what);
unsigned int i;
const char *p;
char *q;
- static struct { char *name; int dw2regnum; } regnames[] =
+ static struct { const char *name; int dw2regnum; } regnames[] =
{
{ "pr", 17 }, { "t", 18 }, { "gbr", 19 }, { "mach", 20 },
{ "macl", 21 }, { "fpul", 23 }
#ifndef DEFAULT_ARCH
#define DEFAULT_ARCH "sparclite"
#endif
-static char *default_arch = DEFAULT_ARCH;
+static const char *default_arch = DEFAULT_ARCH;
/* Non-zero if the initial values of `max_architecture' and `sparc_arch_size'
have been set. */
| HWCAP2_XMPMUL | HWCAP2_XMONT
static struct sparc_arch {
- char *name;
- char *opcode_arch;
+ const char *name;
+ const char *opcode_arch;
enum sparc_arch_types arch_type;
/* Default word size, as specified during configuration.
A value of zero means can't be used to specify default architecture. */
static enum sparc_arch_types default_arch_type;
static struct sparc_arch *
-lookup_arch (char *name)
+lookup_arch (const char *name)
{
struct sparc_arch *sa;
/* Native operand size opcode translation. */
struct
{
- char *name;
- char *name32;
- char *name64;
+ const char *name;
+ const char *name32;
+ const char *name64;
} native_op_table[] =
{
{"ldn", "ld", "ldx"},
struct priv_reg_entry
{
- char *name;
+ const char *name;
int regnum;
};
for (i = 0; native_op_table[i].name; i++)
{
const struct sparc_opcode *insn;
- char *name = ((sparc_arch_size == 32)
+ const char *name = ((sparc_arch_size == 32)
? native_op_table[i].name32
: native_op_table[i].name64);
insn = (struct sparc_opcode *) hash_find (op_hash, name);
static int
sparc_ip (char *str, const struct sparc_opcode **pinsn)
{
- char *error_message = "";
+ const char *error_message = "";
char *s;
const char *args;
char c;
static const struct ops
{
/* The name as it appears in assembler. */
- char *name;
+ const char *name;
/* strlen (name), precomputed for speed */
int len;
/* The reloc this pseudo-op translates to. */
{
char *s1;
- char *op_arg = NULL;
+ const char *op_arg = NULL;
static expressionS op_exp;
bfd_reloc_code_real_type old_reloc = the_insn.reloc;
{
static const struct ops {
/* The name as it appears in assembler. */
- char *name;
+ const char *name;
/* strlen (name), precomputed for speed */
int len;
/* The reloc this pseudo-op translates to. */
for (i = 1; i <= format->arg[0]; i++)
{
int arg = format->arg[i];
- char *exp;
+ const char *exp;
if (i > 1 && arg != A_P && format->arg[i-1] != A_P)
buf[len++] = ',';
if (arg == A_P)
len = strlen (dir);
if (include_dir_count == 0)
{
- include_dirs = (char **) xmalloc (sizeof (*include_dirs));
+ include_dirs = XNEWVEC (const char *, 1);
include_dir_count = 1;
}
include_dirs[0] = dir;
void
md_begin (void)
{
- char *prev_name = "";
+ const char *prev_name = "";
const struct v850_opcode *op;
if (strncmp (TARGET_CPU, "v850e3v5", 8) == 0)
struct visium_arch_option_table
{
- char *name;
+ const char *name;
enum visium_arch_val value;
};
struct visium_long_option_table
{
- char *option; /* Substring to match. */
- char *help; /* Help information. */
+ const char *option; /* Substring to match. */
+ const char *help; /* Help information. */
int (*func) (char *subopt); /* Function to decode sub-option. */
- char *deprecated; /* If non-null, print this message. */
+ const char *deprecated; /* If non-null, print this message. */
};
static int
struct xgate_opcode *xgate_opcode_ptr = NULL;
struct xgate_opcode *xgate_op_table = NULL;
struct xgate_opcode_handle *op_handles = 0;
- char *prev_op_name = 0;
+ const char *prev_op_name = 0;
int handle_enum = 0;
int number_of_op_handles = 0;
int i, j = 0;
/* Make sure the mode supplied is the size of a word. */
static void
-regword (int mode, char *string)
+regword (int mode, const char *string)
{
int ok;
/* Make sure the mode supplied is the size of an address. */
static void
-regaddr (int mode, char *string)
+regaddr (int mode, const char *string)
{
int ok;
struct ctrl_names {
int value;
- char *name;
+ const char *name;
};
static struct ctrl_names ctrl_table[] = {
struct flag_names {
int value;
- char *name;
+ const char *name;
};
static struct flag_names flag_table[] = {
struct interrupt_names {
int value;
- char *name;
+ const char *name;
};
static struct interrupt_names intr_table[] = {
struct cc_names {
int value;
- char *name;
+ const char *name;
};
static struct cc_names table[] = {
/* Variables for handling include file directory table. */
/* Table of pointers to directories to search for .include's. */
-char **include_dirs;
+const char **include_dirs;
/* How many are in the table. */
int include_dir_count;
/* We read the file, putting things into a web that represents what we
have been reading. */
void
-read_a_source_file (char *name)
+read_a_source_file (const char *name)
{
char nul_char;
char next_char;
if (include_dir_count == 0)
{
- include_dirs = (char **) xmalloc (2 * sizeof (*include_dirs));
+ include_dirs = XNEWVEC (const char *, 2);
include_dirs[0] = "."; /* Current dir. */
include_dir_count = 2;
}
else
{
include_dir_count++;
- include_dirs =
- (char **) xrealloc (include_dirs,
- include_dir_count * sizeof (*include_dirs));
+ include_dirs = XRESIZEVEC (const char *, include_dirs,
+ include_dir_count);
}
include_dirs[include_dir_count - 1] = path; /* New one. */
extern const char line_separator_chars[];
/* Table of -I directories. */
-extern char **include_dirs;
+extern const char **include_dirs;
extern int include_dir_count;
extern int include_dir_maxlen;
#define discard_rest_of_line ignore_rest_of_line
extern unsigned output_leb128 (char *, valueT, int);
extern void pseudo_set (symbolS * symbolP);
-extern void read_a_source_file (char *name);
+extern void read_a_source_file (const char *name);
extern void read_begin (void);
extern void read_print_statistics (FILE *);
extern char *read_symbol_name (void);