* output-file.c (output_file_create): Make file name argument const.
(output_file_close): Likewise.
* output-file.h (output_file_create): Adjust.
(output_file_close): Likewise.
* depend.c (quote_string_for_make): Make src argument const char *.
(register_dependency): Likewise.
(wrap_output): Likewise.
* as.h (register_dependency): Adjust.
* config/tc-xtensa.c (finish_vinsn): Remove unnecessary calls to
as_where ();
* symbols.c (S_SET_EXTERNAL): Likewise.
* input-scrub.c (as_where): Return the file name.
* as.h (as_where): Adjust prototype.
* app.c (do_scrub_chars): Adjust.
* cond.c (s_elseif): Likewise.
(s_else): Likewise.
(initialize_cframe): Likewise.
* config/obj-coff.c (obj_coff_init_stab_section): Likewise.
* config/obj-elf.c (obj_elf_init_stab_section): Likewise.
* config/obj-som.c (obj_som_init_stab_section): Likewise.
* config/tc-aarch64.c (output_info): Likewise.
* config/tc-ia64.c (md_assemble): Likewise.
(dot_alias): Likewise.
* config/tc-m68k.c (m68k_frob_label): Likewise.
* config/tc-mmix.c (s_bspec): Likewise.
(mmix_handle_mmixal): Likewise.
* config/tc-rx.c (rx_include): Likewise.
* config/tc-tic54x.c (tic54x_set_default_include): Likewise.
(tic54x_adjust_symtab): Likewise.
* config/tc-xtensa.c (directive_push): Likewise.
(xtensa_sanity_check): Likewise.
(xtensa_relax_frag): Likewise.
(md_convert_frag): Likewise.
(tinsn_to_slotbuf): Likewise.
* dwarf2dbg.c (dwarf2_where): Likewise.
* ecoff.c (add_file): Likewise.
(ecoff_generate_asm_lineno): Likewise.
* expr.c (make_expr_symbol): Likewise.
* frags.c (frag_new): Likewise.
(frag_var_init): Likewise.
* listing.c (listing_newline): Likewise.
* messages.c (identify): Likewise.
(as_show_where): Likewise.
(as_warn_internal): Likewise.
(as_bad_internal): Likewise.
* read.c (s_irp): Likewise.
(s_macro): Likewise.
(s_reloc): Likewise.
* stabs.c (stabs_generate_asm_file): Likewise.
(stabs_generate_asm_lineno): Likewise.
(stabs_generate_asm_func): Likewise.
* write.c (fix_new_internal): Likewise.
* as.h (PRINTF_WHERE_LIKE): Make file name argument const.
(as_warn_value_out_of_range): Adjust prototype.
(as_bad_value_out_of_range): Adjust prototype.
* messages.c (identify): Make file name argument const char *.
(as_warn_internal): Likewise.
(as_warn_where): Likewise.
(as_bad_internal): Likewise.
(as_bad_where): Likewise.
(as_internal_value_out_of_range): Likewise.
(as_warn_value_out_of_range): Likewise.
(as_bad_value_out_of_range): Likewise.
* as.h (found_comment_file): Change type to const char *.
* cond.c (file_line::file): Likewise.
* config/obj-coff.c (obj_coff_init_stab_section): Make variable const.
* config/obj-elf.c (obj_elf_init_stab_section): Likewise.
* config/obj-som.c (obj_som_init_stab_section): Likewise.
* config/tc-aarch64.c (output_info): Likewise.
* config/tc-alpha.c (insert_operand): Likewise.
* config/tc-arc.c (insert_operand): Likewise.
* config/tc-d30v.c (check_size): Likewise.
* config/tc-ia64.c (struct alias): Likewise.
* config/tc-m68k.c (struct label_line): Likewise.
* config/tc-mcore.c (md_apply_fix): Likewise.
* config/tc-microblaze.c (md_estimate_size_before_relax): Likewise.
* config/tc-mips.c (mips16_immed): Likewise.
* config/tc-mmix.c (mmix_handle_mmixal): Likewise.
* config/tc-ppc.c (ppc_insert_operand): Likewise.
* config/tc-rx.c (rx_include): Likewise.
* config/tc-s390.c (s390_insert_operand): Likewise.
* config/tc-tic54x.c (tic54x_set_default_include): Likewise.
(tic54x_adjust_symtab): Likewise.
* config/tc-tilegx.c (insert_operand): Likewise.
(apply_special_operator): Likewise.
* config/tc-tilepro.c (insert_operand): Likewise.
* config/tc-xtensa.c (directive_push): Likewise.
* ecoff.c (add_file): Likewise.
(ecoff_generate_asm_lineno): Likewise.
* listing.c (listing_newline): Likewise.
* read.c (s_irp): Likewise.
* write.c (install_reloc): Likewise.
* write.h (struct fix): Likewise.
* input-file.c (file_name): Change type to const char *.
(saved_file::file_name): Likewise.
(input_file_open): Change type of argument to const char *.
* input-file.h (input_file_open): Adjust.
* input-scrub.c (logical_input_file): change type to const char *.
(physical_input_file): Likewise.
(struct input_save): Adjust.
(input_scrub_push): Adjust.
(input_scrub_begin): Adjust.
(as_where): Adjust.
* input-scrub.c (input_scrub_new_file): Make file name argument const.
(input_scrub_include_file): Likewise.
(new_logical_line_flags): Likewise.
(new_logical_line): Likewise.
* as.h: Adjust.
* frags.h (struct frag): Change type of fr_file to const char *.
* expr.c (expr_symbol_where): Change type of file argument to
const char **.
* expr.h (expr_symbol_where): Likewise.
* config/tc-i370.c (md_apply_fix): adjust.
* config/tc-mmix.c (mmix_md_end): Likewise.
* config/tc-ppc.c (md_apply_fix): Likewise.
* config/tc-s390.c (md_apply_fix): Likewise.
* symbols.c (report_op_error): Likewise.
(resolve_symbol_value): Likewise.
* config/tc-ia64.c (slot::src_file): Change type to const char *.
(rsrc::file): Likewise.
* config/tc-xtensa.c (xtensa_sanity_check): Change type of variable to
const char *.
(xtensa_relax_frag): Likewise.
(md_convert_frag): Likewise.
(tinsn_to_slotbuf): Likewise.
* expr.c (expr_symbol_line): Likewise.
* macro.c (define_macro): Likewise.
* macro.h (macro_struct): Likewise.
* messages.c (as_show_where): Likewise.
* read.c (s_macro): Likewise.
* stabs.c (stabs_generate_asm_file): Likewise.
(generate_asm_file): Likewise.
(stabs_generate_asm_lineno): Likewise.
* write.h (struct reloc_list): Likewise.
* input-scrub.c (as_where): Change return type to const char *.
* as.h (as_wheree): Adjust.
+2016-02-22 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
+
+ * output-file.c (output_file_create): Make file name argument const.
+ (output_file_close): Likewise.
+ * output-file.h (output_file_create): Adjust.
+ (output_file_close): Likewise.
+ * depend.c (quote_string_for_make): Make src argument const char *.
+ (register_dependency): Likewise.
+ (wrap_output): Likewise.
+ * as.h (register_dependency): Adjust.
+ * config/tc-xtensa.c (finish_vinsn): Remove unnecessary calls to
+ as_where ();
+ * symbols.c (S_SET_EXTERNAL): Likewise.
+ * input-scrub.c (as_where): Return the file name.
+ * as.h (as_where): Adjust prototype.
+ * app.c (do_scrub_chars): Adjust.
+ * cond.c (s_elseif): Likewise.
+ (s_else): Likewise.
+ (initialize_cframe): Likewise.
+ * config/obj-coff.c (obj_coff_init_stab_section): Likewise.
+ * config/obj-elf.c (obj_elf_init_stab_section): Likewise.
+ * config/obj-som.c (obj_som_init_stab_section): Likewise.
+ * config/tc-aarch64.c (output_info): Likewise.
+ * config/tc-ia64.c (md_assemble): Likewise.
+ (dot_alias): Likewise.
+ * config/tc-m68k.c (m68k_frob_label): Likewise.
+ * config/tc-mmix.c (s_bspec): Likewise.
+ (mmix_handle_mmixal): Likewise.
+ * config/tc-rx.c (rx_include): Likewise.
+ * config/tc-tic54x.c (tic54x_set_default_include): Likewise.
+ (tic54x_adjust_symtab): Likewise.
+ * config/tc-xtensa.c (directive_push): Likewise.
+ (xtensa_sanity_check): Likewise.
+ (xtensa_relax_frag): Likewise.
+ (md_convert_frag): Likewise.
+ (tinsn_to_slotbuf): Likewise.
+ * dwarf2dbg.c (dwarf2_where): Likewise.
+ * ecoff.c (add_file): Likewise.
+ (ecoff_generate_asm_lineno): Likewise.
+ * expr.c (make_expr_symbol): Likewise.
+ * frags.c (frag_new): Likewise.
+ (frag_var_init): Likewise.
+ * listing.c (listing_newline): Likewise.
+ * messages.c (identify): Likewise.
+ (as_show_where): Likewise.
+ (as_warn_internal): Likewise.
+ (as_bad_internal): Likewise.
+ * read.c (s_irp): Likewise.
+ (s_macro): Likewise.
+ (s_reloc): Likewise.
+ * stabs.c (stabs_generate_asm_file): Likewise.
+ (stabs_generate_asm_lineno): Likewise.
+ (stabs_generate_asm_func): Likewise.
+ * write.c (fix_new_internal): Likewise.
+ * as.h (PRINTF_WHERE_LIKE): Make file name argument const.
+ (as_warn_value_out_of_range): Adjust prototype.
+ (as_bad_value_out_of_range): Adjust prototype.
+ * messages.c (identify): Make file name argument const char *.
+ (as_warn_internal): Likewise.
+ (as_warn_where): Likewise.
+ (as_bad_internal): Likewise.
+ (as_bad_where): Likewise.
+ (as_internal_value_out_of_range): Likewise.
+ (as_warn_value_out_of_range): Likewise.
+ (as_bad_value_out_of_range): Likewise.
+ * as.h (found_comment_file): Change type to const char *.
+ * cond.c (file_line::file): Likewise.
+ * config/obj-coff.c (obj_coff_init_stab_section): Make variable const.
+ * config/obj-elf.c (obj_elf_init_stab_section): Likewise.
+ * config/obj-som.c (obj_som_init_stab_section): Likewise.
+ * config/tc-aarch64.c (output_info): Likewise.
+ * config/tc-alpha.c (insert_operand): Likewise.
+ * config/tc-arc.c (insert_operand): Likewise.
+ * config/tc-d30v.c (check_size): Likewise.
+ * config/tc-ia64.c (struct alias): Likewise.
+ * config/tc-m68k.c (struct label_line): Likewise.
+ * config/tc-mcore.c (md_apply_fix): Likewise.
+ * config/tc-microblaze.c (md_estimate_size_before_relax): Likewise.
+ * config/tc-mips.c (mips16_immed): Likewise.
+ * config/tc-mmix.c (mmix_handle_mmixal): Likewise.
+ * config/tc-ppc.c (ppc_insert_operand): Likewise.
+ * config/tc-rx.c (rx_include): Likewise.
+ * config/tc-s390.c (s390_insert_operand): Likewise.
+ * config/tc-tic54x.c (tic54x_set_default_include): Likewise.
+ (tic54x_adjust_symtab): Likewise.
+ * config/tc-tilegx.c (insert_operand): Likewise.
+ (apply_special_operator): Likewise.
+ * config/tc-tilepro.c (insert_operand): Likewise.
+ * config/tc-xtensa.c (directive_push): Likewise.
+ * ecoff.c (add_file): Likewise.
+ (ecoff_generate_asm_lineno): Likewise.
+ * listing.c (listing_newline): Likewise.
+ * read.c (s_irp): Likewise.
+ * write.c (install_reloc): Likewise.
+ * write.h (struct fix): Likewise.
+ * input-file.c (file_name): Change type to const char *.
+ (saved_file::file_name): Likewise.
+ (input_file_open): Change type of argument to const char *.
+ * input-file.h (input_file_open): Adjust.
+ * input-scrub.c (logical_input_file): change type to const char *.
+ (physical_input_file): Likewise.
+ (struct input_save): Adjust.
+ (input_scrub_push): Adjust.
+ (input_scrub_begin): Adjust.
+ (as_where): Adjust.
+ * input-scrub.c (input_scrub_new_file): Make file name argument const.
+ (input_scrub_include_file): Likewise.
+ (new_logical_line_flags): Likewise.
+ (new_logical_line): Likewise.
+ * as.h: Adjust.
+ * frags.h (struct frag): Change type of fr_file to const char *.
+ * expr.c (expr_symbol_where): Change type of file argument to
+ const char **.
+ * expr.h (expr_symbol_where): Likewise.
+ * config/tc-i370.c (md_apply_fix): adjust.
+ * config/tc-mmix.c (mmix_md_end): Likewise.
+ * config/tc-ppc.c (md_apply_fix): Likewise.
+ * config/tc-s390.c (md_apply_fix): Likewise.
+ * symbols.c (report_op_error): Likewise.
+ (resolve_symbol_value): Likewise.
+ * config/tc-ia64.c (slot::src_file): Change type to const char *.
+ (rsrc::file): Likewise.
+ * config/tc-xtensa.c (xtensa_sanity_check): Change type of variable to
+ const char *.
+ (xtensa_relax_frag): Likewise.
+ (md_convert_frag): Likewise.
+ (tinsn_to_slotbuf): Likewise.
+ * expr.c (expr_symbol_line): Likewise.
+ * macro.c (define_macro): Likewise.
+ * macro.h (macro_struct): Likewise.
+ * messages.c (as_show_where): Likewise.
+ * read.c (s_macro): Likewise.
+ * stabs.c (stabs_generate_asm_file): Likewise.
+ (generate_asm_file): Likewise.
+ (stabs_generate_asm_lineno): Likewise.
+ * write.h (struct reloc_list): Likewise.
+ * input-scrub.c (as_where): Change return type to const char *.
+ * as.h (as_wheree): Adjust.
+
2016-02-21 H.J. Lu <hongjiu.lu@intel.com>
* write.c (compress_debug): Move BFD compression bits setting
* read.c (read_a_source_file): Check for assemble_one returning
with input_line_pointer set to NULL.
-016-02-19 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
+2016-02-19 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
* listing.c (rebuffer_line): Change return type to void.
#ifdef WARN_COMMENTS
if (!found_comment)
- as_where (&found_comment_file, &found_comment);
+ found_comment_file = as_where (&found_comment);
#endif
do
{
void FCN (const char *format, ...) \
__attribute__ ((__format__ (__printf__, 1, 2)))
#define PRINTF_WHERE_LIKE(FCN) \
- void FCN (char *file, unsigned int line, const char *format, ...) \
+ void FCN (const char *file, unsigned int line, const char *format, ...) \
__attribute__ ((__format__ (__printf__, 3, 4)))
#else /* __GNUC__ < 2 || defined(VMS) */
#define PRINTF_LIKE(FCN) void FCN (const char *format, ...)
-#define PRINTF_WHERE_LIKE(FCN) void FCN (char *file, \
+#define PRINTF_WHERE_LIKE(FCN) void FCN (const char *file, \
unsigned int line, \
const char *format, ...)
void sprint_value (char *, addressT);
int had_errors (void);
int had_warnings (void);
-void as_warn_value_out_of_range (char *, offsetT, offsetT, offsetT, char *, unsigned);
-void as_bad_value_out_of_range (char *, offsetT, offsetT, offsetT, char *, unsigned);
+void as_warn_value_out_of_range (char *, offsetT, offsetT, offsetT,
+ const char *, unsigned);
+void as_bad_value_out_of_range (char *, offsetT, offsetT, offsetT,
+ const char *, unsigned);
void print_version_id (void);
char * app_push (void);
char * atof_ieee (char *, int, LITTLENUM_TYPE *);
char * ieee_md_atof (int, char *, int *, bfd_boolean);
char * vax_md_atof (int, char *, int *);
-char * input_scrub_include_file (char *, char *);
+char * input_scrub_include_file (const char *, char *);
void input_scrub_insert_line (const char *);
void input_scrub_insert_file (char *);
-char * input_scrub_new_file (char *);
+char * input_scrub_new_file (const char *);
char * input_scrub_next_buffer (char **bufp);
size_t do_scrub_chars (size_t (*get) (char *, size_t), char *, size_t);
int gen_to_words (LITTLENUM_TYPE *, int, long);
void cond_exit_macro (int);
int seen_at_least_1_file (void);
void app_pop (char *);
-void as_where (char **, unsigned int *);
+const char * as_where (unsigned int *);
void bump_line_counters (void);
void do_scrub_begin (int);
void input_scrub_begin (void);
void input_scrub_close (void);
void input_scrub_end (void);
-int new_logical_line (char *, int);
-int new_logical_line_flags (char *, int, int);
+int new_logical_line (const char *, int);
+int new_logical_line_flags (const char *, int, int);
void subsegs_begin (void);
void subseg_change (segT, int);
segT subseg_new (const char *, subsegT);
int subseg_text_p (segT);
int seg_not_empty_p (segT);
void start_dependencies (char *);
-void register_dependency (char *);
+void register_dependency (const char *);
void print_dependencies (void);
segT subseg_get (const char *, int);
#ifdef WARN_COMMENTS
COMMON int warn_comment;
COMMON unsigned int found_comment;
-COMMON char * found_comment_file;
+COMMON const char * found_comment_file;
#endif
#if defined OBJ_ELF || defined OBJ_MAYBE_ELF
struct obstack cond_obstack;
struct file_line {
- char *file;
+ const char *file;
unsigned int line;
};
}
else
{
- as_where (¤t_cframe->else_file_line.file,
- ¤t_cframe->else_file_line.line);
+ current_cframe->else_file_line.file
+ = as_where (¤t_cframe->else_file_line.line);
current_cframe->dead_tree |= !current_cframe->ignoring;
current_cframe->ignoring = current_cframe->dead_tree;
}
else
{
- as_where (¤t_cframe->else_file_line.file,
- ¤t_cframe->else_file_line.line);
+ current_cframe->else_file_line.file
+ = as_where (¤t_cframe->else_file_line.line);
current_cframe->ignoring =
current_cframe->dead_tree | !current_cframe->ignoring;
initialize_cframe (struct conditional_frame *cframe)
{
memset (cframe, 0, sizeof (*cframe));
- as_where (&cframe->if_file_line.file,
- &cframe->if_file_line.line);
+ cframe->if_file_line.file
+ = as_where (&cframe->if_file_line.line);
cframe->previous_cframe = current_cframe;
cframe->dead_tree = current_cframe != NULL && current_cframe->ignoring;
cframe->macro_nest = macro_nest;
void
obj_coff_init_stab_section (segT seg)
{
- char *file;
+ const char *file;
char *p;
char *stabstr_name;
unsigned int stroff;
p = frag_more (12);
/* Zero it out. */
memset (p, 0, 12);
- as_where (&file, (unsigned int *) NULL);
+ file = as_where ((unsigned int *) NULL);
stabstr_name = xmalloc (strlen (seg->name) + 4);
strcpy (stabstr_name, seg->name);
strcat (stabstr_name, "str");
void
obj_elf_init_stab_section (segT seg)
{
- char *file;
+ const char *file;
char *p;
char *stabstr_name;
unsigned int stroff;
p = frag_more (12);
/* Zero it out. */
memset (p, 0, 12);
- as_where (&file, NULL);
+ file = as_where (NULL);
stabstr_name = (char *) xmalloc (strlen (segment_name (seg)) + 4);
strcpy (stabstr_name, segment_name (seg));
strcat (stabstr_name, "str");
segT saved_seg = now_seg;
segT space;
subsegT saved_subseg = now_subseg;
- char *p, *file;
+ char *p;
+ const char * file;
unsigned int stroff;
/* Make the space which will contain the debug subspaces. */
the call to get_stab_string_offset. */
p = frag_more (12);
memset (p, 0, 12);
- as_where (&file, (unsigned int *) NULL);
+ file = as_where ((unsigned int *) NULL);
stroff = get_stab_string_offset (file, "$GDB_STRINGS$");
know (stroff == 1);
md_number_to_chars (p, stroff, 4);
static void
output_info (const char *format, ...)
{
- char *file;
+ const char *file;
unsigned int line;
va_list args;
- as_where (&file, &line);
+ file = as_where (&line);
if (file)
{
if (line != 0)
insert_operand (unsigned insn,
const struct alpha_operand *operand,
offsetT val,
- char *file,
+ const char *file,
unsigned line)
{
if (operand->bits != 32 && !(operand->flags & AXP_OPERAND_NOOVERFLOW))
insert_operand (unsigned insn,
const struct arc_operand *operand,
offsetT val,
- char *file,
+ const char *file,
unsigned line)
{
offsetT min = 0, max = 0;
}
static void
-check_size (long value, int bits, char *file, int line)
+check_size (long value, int bits, const char *file, int line)
{
int tmp, max;
any operands that need relocation. Due to the 12-bit naturew of
i370 addressing, this would be unusual. */
{
- char *sfile;
+ const char *sfile;
unsigned int sline;
/* Use expr_symbol_where to see if this is an expression
struct label_fix *tag_fixups;
struct unw_rec_list *unwind_record; /* Unwind directive. */
expressionS opnd[6];
- char *src_file;
+ const char *src_file;
unsigned int src_line;
struct dwarf2_line_info debug_line;
}
int insn_srlz; /* current insn serialization state */
int data_srlz; /* current data serialization state */
int qp_regno; /* qualifying predicate for this usage */
- char *file; /* what file marked this dependency */
+ const char *file; /* what file marked this dependency */
unsigned int line; /* what line marked this dependency */
struct mem_offset mem_offset; /* optional memory offset hint */
enum { CMP_NONE, CMP_OR, CMP_AND } cmp_type; /* OR or AND compare? */
/* Build the instruction. */
CURR_SLOT.qp_regno = qp_regno;
CURR_SLOT.idesc = idesc;
- as_where (&CURR_SLOT.src_file, &CURR_SLOT.src_line);
+ CURR_SLOT.src_file = as_where (&CURR_SLOT.src_line);
dwarf2_where (&CURR_SLOT.debug_line);
dwarf2_consume_line_info ();
the relocatable file. */
struct alias
{
- char *file; /* The file where the directive is seen. */
+ const char *file; /* The file where the directive is seen. */
unsigned int line; /* The line number the directive is at. */
const char *name; /* The original name of the symbol. */
};
}
h = (struct alias *) xmalloc (sizeof (struct alias));
- as_where (&h->file, &h->line);
+ h->file = as_where (&h->line);
h->name = name;
error_string = hash_jam (ahash, alias, (void *) h);
{
struct label_line *next;
symbolS *label;
- char *file;
+ const char *file;
unsigned int line;
int text;
};
n = (struct label_line *) xmalloc (sizeof *n);
n->next = labels;
n->label = sym;
- as_where (&n->file, &n->line);
+ n->file = as_where (&n->line);
n->text = 0;
labels = n;
current_label = n;
segT segment ATTRIBUTE_UNUSED)
{
char * buf = fixP->fx_where + fixP->fx_frag->fr_literal;
- char * file = fixP->fx_file ? fixP->fx_file : _("unknown");
+ const char * file = fixP->fx_file ? fixP->fx_file : _("unknown");
const char * symname;
/* Note: use offsetT because it is signed, valueT is unsigned. */
offsetT val = *valP;
segT segment)
{
char * buf = fixP->fx_where + fixP->fx_frag->fr_literal;
- char * file = fixP->fx_file ? fixP->fx_file : _("unknown");
+ const char * file = fixP->fx_file ? fixP->fx_file : _("unknown");
const char * symname;
/* Note: use offsetT because it is signed, valueT is unsigned. */
offsetT val = (offsetT) * valp;
{
/* Variable not in small data read only segment accessed
using small data read only anchor. */
- char *file = fragP->fr_file ? fragP->fr_file : _("unknown");
+ const char *file = fragP->fr_file ? fragP->fr_file : _("unknown");
as_bad_where (file, fragP->fr_line,
_("Variable is accessed using small data read "
}
else
{
- char *file = fragP->fr_file ? fragP->fr_file : _("unknown");
+ const char *file = fragP->fr_file ? fragP->fr_file : _("unknown");
as_bad_where (file, fragP->fr_line,
_("Variable is accessed using small data read "
static void mips_ip (char *str, struct mips_cl_insn * ip);
static void mips16_ip (char *str, struct mips_cl_insn * ip);
static void mips16_immed
- (char *, unsigned int, int, bfd_reloc_code_real_type, offsetT,
+ (const char *, unsigned int, int, bfd_reloc_code_real_type, offsetT,
unsigned int, unsigned long *);
static size_t my_getSmallExpression
(expressionS *, bfd_reloc_code_real_type *, char *);
is the length that the user requested, or 0 if none. */
static void
-mips16_immed (char *file, unsigned int line, int type,
+mips16_immed (const char *file, unsigned int line, int type,
bfd_reloc_code_real_type reloc, offsetT val,
unsigned int user_insn_length, unsigned long *insn)
{
/* Do we have a BSPEC in progress? */
static int doing_bspec = 0;
-static char *bspec_file;
+static const char *bspec_file;
static unsigned int bspec_line;
struct option md_longopts[] =
subseg_set (sec, 0);
/* Save position for missing ESPEC. */
- as_where (&bspec_file, &bspec_line);
+ bspec_file = as_where (&bspec_line);
doing_bspec = 1;
}
caller is about to bump the counters. Adjust the error messages. */
if (is_end_of_line[(unsigned int) *s])
{
- char *name;
unsigned int line;
- as_where (&name, &line);
+ const char * name = as_where (&line);
as_bad_where (name, line + 1,
_("[0-9]H labels may not appear alone on a line"));
current_fb_label = -1;
}
if (*s == '.')
{
- char *name;
unsigned int line;
- as_where (&name, &line);
+ const char * name = as_where (&line);
as_bad_where (name, line + 1,
_("[0-9]H labels do not mix with dot-pseudos"));
current_fb_label = -1;
actual_seg = S_GET_SEGMENT (loc_assert->loc_sym);
if (actual_seg != loc_assert->old_seg)
{
- char *fnam;
+ const char *fnam;
unsigned int line;
int e_valid = expr_symbol_where (loc_assert->loc_sym, &fnam, &line);
const struct powerpc_operand *operand,
offsetT val,
ppc_cpu_t cpu,
- char *file,
+ const char *file,
unsigned int line)
{
long min, max, right;
gas_assert (fixP->fx_addsy != NULL);
if (fixP->fx_r_type == BFD_RELOC_NONE)
{
- char *sfile;
+ const char *sfile;
unsigned int sline;
/* Use expr_symbol_where to see if this is an expression
default:
if (fixP->fx_addsy)
{
- char *sfile;
+ const char *sfile;
unsigned int sline;
/* Use expr_symbol_where to see if this is an
FILE * try;
char * path;
char * filename;
- char * current_filename;
+ const char * current_filename;
char * last_char;
- char * p;
- char * d;
+ const char * p;
+ const char * d;
char * f;
char end_char;
size_t len;
return;
}
- as_where (& current_filename, NULL);
+ current_filename = as_where (NULL);
f = (char *) xmalloc (strlen (current_filename) + strlen (filename) + 1);
/* Check the filename. If [@]..FILE[@] is found then replace
of any directory prefixes or extensions. */
if ((p = rx_strcasestr (filename, "..file")) != NULL)
{
- char * c;
+ const char * c;
len = 6; /* strlen ("..file"); */
s390_insert_operand (unsigned char *insn,
const struct s390_operand *operand,
offsetT val,
- char *file,
+ const char *file,
unsigned int line)
{
addressT uval;
}
else
{
- char *sfile;
+ const char *sfile;
unsigned int sline;
/* Use expr_symbol_where to see if this is an expression
if (!dot)
{
- char *curfile;
+ const char *curfile;
unsigned lineno;
- as_where (&curfile, &lineno);
+ curfile = as_where (&lineno);
dir = strcpy (xmalloc (strlen (curfile) + 1), curfile);
tmp = strrchr (dir, '/');
}
if (symbol_rootP == NULL
|| S_GET_STORAGE_CLASS (symbol_rootP) != C_FILE)
{
- char *filename;
unsigned lineno;
- as_where (&filename, &lineno);
+ const char * filename = as_where (&lineno);
c_dot_file_symbol (filename, 0);
}
}
insert_operand (tilegx_bundle_bits bits,
const struct tilegx_operand *operand,
int operand_value,
- char *file,
+ const char *file,
unsigned lineno)
{
/* Range-check the immediate. */
static int
-apply_special_operator (operatorT op, offsetT num, char *file, unsigned lineno)
+apply_special_operator (operatorT op, offsetT num, const char *file,
+ unsigned lineno)
{
int ret;
int check_shift = -1;
insert_operand (tilepro_bundle_bits bits,
const struct tilepro_operand *operand,
int operand_value,
- char *file,
+ const char *file,
unsigned lineno)
{
/* Range-check the immediate. */
static void
directive_push (directiveE directive, bfd_boolean negated, const void *datum)
{
- char *file;
+ const char *file;
unsigned int line;
state_stackS *stack = (state_stackS *) xmalloc (sizeof (state_stackS));
- as_where (&file, &line);
+ file = as_where (&line);
stack->directive = directive;
stack->negated = negated;
{
IStack slotstack;
int i;
- char *file_name;
- unsigned line;
if (find_vinsn_conflicts (vinsn))
{
if (vinsn->format == XTENSA_UNDEFINED)
{
- as_where (&file_name, &line);
- as_bad_where (file_name, line,
- _("couldn't find a valid instruction format"));
+ as_bad (_("couldn't find a valid instruction format"));
fprintf (stderr, _(" ops were: "));
for (i = 0; i < vinsn->num_slots; i++)
fprintf (stderr, _(" %s;"),
if (resources_conflict (vinsn))
{
- as_where (&file_name, &line);
- as_bad_where (file_name, line, _("illegal resource usage in bundle"));
+ as_bad (_("illegal resource usage in bundle"));
fprintf (stderr, " ops were: ");
for (i = 0; i < vinsn->num_slots; i++)
fprintf (stderr, " %s;",
/* Now check resource conflicts on the modified bundle. */
if (resources_conflict (vinsn))
{
- as_where (&file_name, &line);
- as_bad_where (file_name, line, _("illegal resource usage in bundle"));
+ as_bad (_("illegal resource usage in bundle"));
fprintf (stderr, " ops were: ");
for (i = 0; i < vinsn->num_slots; i++)
fprintf (stderr, " %s;",
static void
xtensa_sanity_check (void)
{
- char *file_name;
+ const char *file_name;
unsigned line;
frchainS *frchP;
asection *s;
- as_where (&file_name, &line);
+ file_name = as_where (&line);
for (s = stdoutput->sections; s; s = s->next)
for (frchP = seg_info (s)->frchainP; frchP; frchP = frchP->frch_next)
{
xtensa_isa isa = xtensa_default_isa;
int unreported = fragP->tc_frag_data.unreported_expansion;
long new_stretch = 0;
- char *file_name;
+ const char *file_name;
unsigned line;
int lit_size;
static xtensa_insnbuf vbuf = NULL;
int slot, num_slots;
xtensa_format fmt;
- as_where (&file_name, &line);
+ file_name = as_where (&line);
new_logical_line (fragP->fr_file, fragP->fr_line);
fragP->tc_frag_data.unreported_expansion = 0;
int slot;
int num_slots;
xtensa_format fmt;
- char *file_name;
+ const char *file_name;
unsigned line;
- as_where (&file_name, &line);
+ file_name = as_where (&line);
new_logical_line (fragp->fr_file, fragp->fr_line);
switch (fragp->fr_subtype)
expressionS *exp = &tinsn->tok[i];
int rc;
unsigned line;
- char *file_name;
+ const char *file_name;
uint32 opnd_value;
switch (exp->X_op)
case O_constant:
if (xtensa_operand_is_visible (isa, opcode, i) == 0)
break;
- as_where (&file_name, &line);
+ file_name = as_where (&line);
/* It is a constant and we called this function
then we have to try to fit it. */
xtensa_insnbuf_set_operand (slotbuf, fmt, slot, opcode, i,
static char * dep_file = NULL;
struct dependency
- {
- char * file;
- struct dependency * next;
- };
+{
+ char * file;
+ struct dependency * next;
+};
/* All the files we depend on. */
static struct dependency * dep_chain = NULL;
/* Current column in output file. */
static int column = 0;
-static int quote_string_for_make (FILE *, char *);
-static void wrap_output (FILE *, char *, int);
+static int quote_string_for_make (FILE *, const char *);
+static void wrap_output (FILE *, const char *, int);
/* Number of columns allowable. */
#define MAX_COLUMNS 72
/* Noticed a new filename, so try to register it. */
void
-register_dependency (char *filename)
+register_dependency (const char *filename)
{
struct dependency *dep;
This code is taken from gcc with only minor changes. */
static int
-quote_string_for_make (FILE *file, char *src)
+quote_string_for_make (FILE *file, const char *src)
{
- char *p = src;
+ const char *p = src;
int i = 0;
for (;;)
preceded by 2N backslashes represents N backslashes at
the end of a file name; and backslashes in other
contexts should not be doubled. */
- char *q;
+ const char *q;
for (q = p - 1; src < q && q[-1] == '\\'; q--)
{
wrapping as necessary. */
static void
-wrap_output (FILE *f, char *string, int spacer)
+wrap_output (FILE *f, const char *string, int spacer)
{
int len = quote_string_for_make (NULL, string);
{
if (debug_type == DEBUG_DWARF2)
{
- char *filename;
- as_where (&filename, &line->line);
+ const char *filename = as_where (&line->line);
line->filenum = get_filenum (filename, 0);
line->column = 0;
line->flags = DWARF2_FLAG_IS_STMT;
want to use the actual file name. */
if (file_name == (const char *) NULL)
{
- char *file;
-
if (first_file != (efdr_t *) NULL)
as_fatal (_("fake .file after real one"));
- as_where (&file, (unsigned int *) NULL);
- file_name = (const char *) file;
+ file_name = as_where ((unsigned int *) NULL);
/* Automatically generate ECOFF debugging information, since I
think that's what other ECOFF assemblers do. We don't do
ecoff_generate_asm_lineno (void)
{
unsigned int lineno;
- char *filename;
+ const char *filename;
lineno_list_t *list;
- as_where (&filename, &lineno);
+ filename = as_where (&lineno);
if (current_stabs_filename == (char *) NULL
|| filename_cmp (current_stabs_filename, filename))
struct expr_symbol_line {
struct expr_symbol_line *next;
symbolS *sym;
- char *file;
+ const char *file;
unsigned int line;
};
n = (struct expr_symbol_line *) xmalloc (sizeof *n);
n->sym = symbolP;
- as_where (&n->file, &n->line);
+ n->file = as_where (&n->line);
n->next = expr_symbol_lines;
expr_symbol_lines = n;
the symbol. */
int
-expr_symbol_where (symbolS *sym, char **pfile, unsigned int *pline)
+expr_symbol_where (symbolS *sym, const char **pfile, unsigned int *pline)
{
struct expr_symbol_line *l;
extern segT expr (int, expressionS *, enum expr_mode);
extern unsigned int get_single_number (void);
extern symbolS *make_expr_symbol (expressionS * expressionP);
-extern int expr_symbol_where (symbolS *, char **, unsigned int *);
+extern int expr_symbol_where (symbolS *, const char **, unsigned int *);
extern void current_location (expressionS *);
extern symbolS *expr_build_uconstant (offsetT);
gas_assert (former_last_fragP == frag_now);
frag_now = frag_alloc (&frchP->frch_obstack);
- as_where (&frag_now->fr_file, &frag_now->fr_line);
+ frag_now->fr_file = as_where (&frag_now->fr_line);
/* Generally, frag_now->points to an address rounded up to next
alignment. However, characters will add to obstack frags
#ifdef TC_FRAG_INIT
TC_FRAG_INIT (frag_now);
#endif
- as_where (&frag_now->fr_file, &frag_now->fr_line);
+ frag_now->fr_file = as_where (&frag_now->fr_line);
frag_new (max_chars);
}
struct frag *fr_next;
/* Where the frag was created, or where it became a variant frag. */
- char *fr_file;
+ const char *fr_file;
unsigned int fr_line;
#ifndef NO_LISTING
/* We use static data: the data area is not sharable. */
static FILE *f_in;
-static char *file_name;
+static const char *file_name;
/* Struct for saving the state of this module for file includes. */
struct saved_file
{
FILE * f_in;
- char * file_name;
+ const char * file_name;
int preprocess;
char * app_save;
};
free (arg);
}
\f
+/* Open the specified file, "" means stdin. Filename must not be null. */
+
void
-input_file_open (char *filename, /* "" means use stdin. Must not be 0. */
+input_file_open (const char *filename,
int pre)
{
int c;
void input_file_begin (void);
void input_file_close (void);
void input_file_end (void);
-void input_file_open (char *filename, int pre);
+void input_file_open (const char *filename, int pre);
void input_file_pop (char *arg);
source line numbers. Whenever we open a file we must fill in
physical_input_file. So if it is NULL we have not opened any files yet. */
-static char *physical_input_file;
-static char *logical_input_file;
+static const char *physical_input_file;
+static const char *logical_input_file;
/* 1-origin line number in a source file. */
/* A line ends in '\n' or eof. */
int partial_size;
char save_source[AFTER_SIZE];
size_t buffer_length;
- char * physical_input_file;
- char * logical_input_file;
+ const char * physical_input_file;
+ const char * logical_input_file;
unsigned int physical_input_line;
int logical_input_line;
size_t sb_index;
input_file_begin (); /* Reinitialize! */
logical_input_line = -1;
- logical_input_file = (char *) NULL;
+ logical_input_file = NULL;
buffer_length = input_file_buffer_size ();
sb_index = -1;
/* Line number things. */
logical_input_line = -1;
- logical_input_file = (char *) NULL;
+ logical_input_file = NULL;
physical_input_file = NULL; /* No file read yet. */
next_saved_file = NULL; /* At EOF, don't pop to any other file */
do_scrub_begin (flag_m68k_mri);
Return start of caller's part of buffer. */
char *
-input_scrub_new_file (char *filename)
+input_scrub_new_file (const char *filename)
{
input_file_open (filename, !flag_no_comments);
physical_input_file = filename[0] ? filename : _("{standard input}");
input_scrub_new_file. */
char *
-input_scrub_include_file (char *filename, char *position)
+input_scrub_include_file (const char *filename, char *position)
{
next_saved_file = input_scrub_push (position);
return input_scrub_new_file (filename);
Returns nonzero if the filename actually changes. */
int
-new_logical_line_flags (char *fname, /* DON'T destroy it! We point to it! */
+new_logical_line_flags (const char *fname, /* DON'T destroy it! We point to it! */
int line_number,
int flags)
{
}
int
-new_logical_line (char *fname, int line_number)
+new_logical_line (const char *fname, int line_number)
{
return new_logical_line_flags (fname, line_number, 0);
}
\f
-/* Return the current file name and line number.
- namep should be char * const *, but there are compilers which screw
- up declarations like that, and it's easier to avoid it. */
+/* Return the current file name and line number. */
-void
-as_where (char **namep, unsigned int *linep)
+const char *
+as_where (unsigned int *linep)
{
if (logical_input_file != NULL
&& (linep == NULL || logical_input_line >= 0))
{
- *namep = logical_input_file;
if (linep != NULL)
*linep = logical_input_line;
+ return logical_input_file;
}
else if (physical_input_file != NULL)
{
- *namep = physical_input_file;
if (linep != NULL)
*linep = physical_input_line;
+ return physical_input_file;
}
else
{
- *namep = 0;
if (linep != NULL)
*linep = 0;
+ return NULL;
}
}
void
listing_newline (char *ps)
{
- char *file;
+ const char *file;
unsigned int line;
static unsigned int last_line = 0xffff;
- static char *last_file = NULL;
+ static const char *last_file = NULL;
list_info_type *new_i = NULL;
if (listing == 0)
}
#endif
- as_where (&file, &line);
+ file = as_where (&line);
if (ps == NULL)
{
if (line == last_line
const char *
define_macro (size_t idx, sb *in, sb *label,
size_t (*get_line) (sb *),
- char *file, unsigned int line,
+ const char *file, unsigned int line,
const char **namep)
{
macro_entry *macro;
formal_entry *formals; /* Pointer to list of formal_structs. */
struct hash_control *formal_hash; /* Hash table of formals. */
const char *name; /* Macro name. */
- char *file; /* File the macro was defined in. */
+ const char *file; /* File the macro was defined in. */
unsigned int line; /* Line number of definition. */
} macro_entry;
extern void macro_set_alternate (int);
extern void macro_mri_mode (int);
extern const char *define_macro (size_t, sb *, sb *, size_t (*) (sb *),
- char *, unsigned int, const char **);
+ const char *, unsigned int, const char **);
extern int check_macro (const char *, sb *, const char **, macro_entry **);
extern void delete_macro (const char *);
extern const char *expand_irp (int, size_t, sb *, sb *, size_t (*) (sb *));
#include "as.h"
-static void identify (char *);
+static void identify (const char *);
static void as_show_where (void);
-static void as_warn_internal (char *, unsigned int, char *);
-static void as_bad_internal (char *, unsigned int, char *);
+static void as_warn_internal (const char *, unsigned int, char *);
+static void as_bad_internal (const char *, unsigned int, char *);
/* Despite the rest of the comments in this file, (FIXME-SOON),
here is the current scheme for error messages etc:
continues as though no error occurred. */
static void
-identify (char *file)
+identify (const char *file)
{
static int identified;
if (!file)
{
unsigned int x;
- as_where (&file, &x);
+ file = as_where (&x);
}
if (file)
static void
as_show_where (void)
{
- char *file;
+ const char *file;
unsigned int line;
- as_where (&file, &line);
+ file = as_where (&line);
identify (file);
if (file)
{
/* The common portion of as_warn and as_warn_where. */
static void
-as_warn_internal (char *file, unsigned int line, char *buffer)
+as_warn_internal (const char *file, unsigned int line, char *buffer)
{
++warning_count;
if (file == NULL)
- as_where (&file, &line);
+ file = as_where (&line);
identify (file);
if (file)
the varargs correctly and portably. */
void
-as_warn_where (char *file, unsigned int line, const char *format, ...)
+as_warn_where (const char *file, unsigned int line, const char *format, ...)
{
va_list args;
char buffer[2000];
/* The common portion of as_bad and as_bad_where. */
static void
-as_bad_internal (char *file, unsigned int line, char *buffer)
+as_bad_internal (const char *file, unsigned int line, char *buffer)
{
++error_count;
if (file == NULL)
- as_where (&file, &line);
+ file = as_where (&line);
identify (file);
if (file)
the varargs correctly and portably. */
void
-as_bad_where (char *file, unsigned int line, const char *format, ...)
+as_bad_where (const char *file, unsigned int line, const char *format, ...)
{
va_list args;
char buffer[2000];
offsetT val,
offsetT min,
offsetT max,
- char * file,
+ const char * file,
unsigned line,
int bad)
{
offsetT value,
offsetT min,
offsetT max,
- char * file,
+ const char * file,
unsigned line)
{
as_internal_value_out_of_range (prefix, value, min, max, file, line, 0);
offsetT value,
offsetT min,
offsetT max,
- char * file,
+ const char * file,
unsigned line)
{
as_internal_value_out_of_range (prefix, value, min, max, file, line, 1);
bfd *stdoutput;
void
-output_file_create (char *name)
+output_file_create (const char *name)
{
if (name[0] == '-' && name[1] == '\0')
as_fatal (_("can't open a bfd on stdout %s"), name);
}
void
-output_file_close (char *filename)
+output_file_close (const char *filename)
{
bfd_boolean res;
the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
void output_file_append (char *where, long length, char *filename);
-void output_file_close (char *filename);
-void output_file_create (char *name);
+void output_file_close (const char *filename);
+void output_file_create (const char *name);
/* end of output-file.h */
void
s_irp (int irpc)
{
- char *file, *eol;
+ char * eol;
+ const char * file;
unsigned int line;
sb s;
const char *err;
sb out;
- as_where (&file, &line);
+ file = as_where (&line);
eol = find_end_of_line (input_line_pointer, 0);
sb_build (&s, eol - input_line_pointer);
void
s_macro (int ignore ATTRIBUTE_UNUSED)
{
- char *file, *eol;
+ char *eol;
+ const char * file;
unsigned int line;
sb s;
const char *err;
const char *name;
- as_where (&file, &line);
+ file = as_where (&line);
eol = find_end_of_line (input_line_pointer, 0);
sb_build (&s, eol - input_line_pointer);
break;
}
- as_where (&reloc->file, &reloc->line);
+ reloc->file = as_where (&reloc->line);
reloc->next = reloc_list;
reloc_list = reloc;
int outputting_stabs_line_debug = 0;
static void s_stab_generic (int, const char *, const char *);
-static void generate_asm_file (int, char *);
+static void generate_asm_file (int, const char *);
/* Allow backends to override the names used for the stab sections. */
#ifndef STAB_SECTION_NAME
void
stabs_generate_asm_file (void)
{
- char *file;
+ const char *file;
unsigned int lineno;
- as_where (&file, &lineno);
+ file = as_where (&lineno);
if (use_gnu_debug_info_extensions)
{
const char *dir;
TYPE is one of N_SO, N_SOL. */
static void
-generate_asm_file (int type, char *file)
+generate_asm_file (int type, const char *file)
{
static char *last_file;
static int label_count;
char *hold;
char sym[30];
char *buf;
- char *tmp = file;
- char *file_endp = file + strlen (file);
+ const char *tmp = file;
+ const char *file_endp = file + strlen (file);
char *bufp;
if (last_file != NULL
{
static int label_count;
char *hold;
- char *file;
+ const char *file;
unsigned int lineno;
char *buf;
char sym[30];
hold = input_line_pointer;
- as_where (&file, &lineno);
+ file = as_where (&lineno);
/* Don't emit sequences of stabs for the same line. */
if (prev_file == NULL)
static int void_emitted_p;
char *hold = input_line_pointer;
char *buf;
- char *file;
unsigned int lineno;
if (! void_emitted_p)
void_emitted_p = 1;
}
- as_where (&file, &lineno);
+ as_where (&lineno);
if (asprintf (&buf, "\"%s:F1\",%d,0,%d,%s",
funcname, N_FUN, lineno + 1, startlabname) == -1)
as_fatal ("%s", xstrerror (errno));
static void
report_op_error (symbolS *symp, symbolS *left, operatorT op, symbolS *right)
{
- char *file;
+ const char *file;
unsigned int line;
segT seg_left = left ? S_GET_SEGMENT (left) : 0;
segT seg_right = S_GET_SEGMENT (right);
already issued a warning about using a bad symbol. */
if (seg_right == absolute_section && finalize_syms)
{
- char *file;
+ const char *file;
unsigned int line;
if (expr_symbol_where (symp, &file, &line))
}
if (s->bsym->flags & BSF_SECTION_SYM)
{
- char * file;
- unsigned int line;
-
/* Do not reassign section symbols. */
- as_where (& file, & line);
- as_warn_where (file, line,
- _("section symbols are already global"));
+ as_warn (_("section symbols are already global"));
return;
}
#ifndef TC_GLOBAL_REGISTER_SYMBOL_OK
TC_INIT_FIX_DATA (fixP);
#endif
- as_where (&fixP->fx_file, &fixP->fx_line);
+ fixP->fx_file = as_where (&fixP->fx_line);
{
static void
install_reloc (asection *sec, arelent *reloc, fragS *fragp,
- char *file, unsigned int line)
+ const char *file, unsigned int line)
{
char *err;
bfd_reloc_status_type s;
/* The location of the instruction which created the reloc, used
in error messages. */
- char *fx_file;
+ const char *fx_file;
unsigned fx_line;
#ifdef USING_CGEN
arelent r;
} b;
} u;
- char *file;
+ const char *file;
unsigned int line;
};