aboutsummaryrefslogtreecommitdiff
path: root/gas/input-scrub.c
AgeCommit message (Collapse)AuthorFilesLines
7 daysgas: multi-byte warning adjustmentsJan Beulich1-5/+0
First input_scrub_next_buffer()'s invocation was wrong, leading to input only being checked from the last newline till the end of the current buffer. Correcting the invocation, however, leads to duplicate checking unless -f (or the #NO_APP equivalent thereof) is in effect. Move the invocation to input_file_give_next_buffer(), to restrict it accordingly. Then, when macros contain multi-byte characters, warning about them again in every expansion isn't useful. Suppress such warnings from sb_scrub_and_add_sb().
2024-01-04Update year range in copyright notice of binutils filesAlan Modra1-1/+1
Adds two new external authors to etc/update-copyright.py to cover bfd/ax_tls.m4, and adds gprofng to dirs handled automatically, then updates copyright messages as follows: 1) Update cgen/utils.scm emitted copyrights. 2) Run "etc/update-copyright.py --this-year" with an extra external author I haven't committed, 'Kalray SA.', to cover gas testsuite files (which should have their copyright message removed). 3) Build with --enable-maintainer-mode --enable-cgen-maint=yes. 4) Check out */po/*.pot which we don't update frequently.
2023-01-19Reinitialise macro_nestAlan Modra1-0/+1
* input-scrub.c (input_scrub_begin): Init macro_nest.
2023-01-01Update year range in copyright notice of binutils filesAlan Modra1-1/+1
The newer update-copyright.py fixes file encoding too, removing cr/lf on binutils/bfdtest2.c and ld/testsuite/ld-cygwin/exe-export.exp, and embedded cr in binutils/testsuite/binutils-all/ar.exp string match.
2022-12-16gas: restore Dwarf info generation after macro diagnostic adjustmentsJan Beulich1-3/+0
While 6fdb723799e2 ("gas: re-work line number tracking for macros and their expansions") was meant to leave generated Dwarf as is, it really didn't (and the testcase intended to catch that wasn't covering the case which broke). Its adjustment to buffer_and_nest() didn't go far enough, leading to the "linefile" directive inserted at the top to also be processed later in the PR gas/16908 workaround (which clearly isn't intended - it's being put there for processing during macro expansion only). That unnoticed flaw in turn led me to work around it by a (suspicious to me already at the time) conditional in as_where().
2022-12-13gas: re-work line number tracking for macros and their expansionsJan Beulich1-23/+79
The PR gas/16908 workaround aimed at uniformly reporting line numbers to reference macro invocation sites. As mentioned in a comment this may be desirable for small macros, but often isn't for larger ones. As a first step improve diagnostics to report both locations, while aiming at leaving generated debug info unaltered. Note that macro invocation context is lost for any diagnostics issued only after all input was processed (or more generally for any use of as_*_where(), as the functions can't know whether the passed in location is related to [part of] the present stack of locations). To maintain the intended workaround behavior for PR gas/16908, a new as_where() is introduced to "look through" macro invocations, while the existing as_where() is renamed (and used in only very few places for now). Down the road as_where() will likely want to return a list of (file,line) pairs.
2022-11-11gas: accept custom ".linefile <n> ."Jan Beulich1-2/+4
While .linefile is generally intended for gas internal use only, its use in a source file would better not result in an internal error. Give use of it outside of any macro(-like) construct the meaning of restoring the original (physical) input file name.
2022-08-11PR29466, APP/NO_APP with .linefileAlan Modra1-2/+4
Commit 53f2b36a54b9 exposed a bug in sb_scrub_and_add_sb that could result in losing input. If scrubbing results in expansion past the holding capacity of do_scrub_chars output buffer, then do_scrub_chars stashes the extra input for the next call. That call never came because sb_scrub_and_add_sb wrongly decided it was done. Fix that by allowing sb_scrub_and_add_sb to see whether there is pending input. Also allow a little extra space so that in most cases we won't need to resize the output buffer. sb_scrub_and_add_sb also limited output to the size of the input, rather than the actual output buffer size. Fixing that resulted in a fail of gas/testsuite/macros/dot with an extra warning: "end of file not at end of a line; newline inserted". OK, so the macro in dot.s really does finish without end-of-line. Apparently the macro expansion code relied on do_scrub_chars returning early. So fix that too by adding a newline if needed in macro_expand_body. PR 29466 * app.c (do_scrub_pending): New function. * as.h: Declare it. * input-scrub.c (input_scrub_include_sb): Add extra space for two .linefile directives. * sb.c (sb_scrub_and_add_sb): Take into account pending input. Allow output to max. * macro.c (macro_expand_body): Add terminating newline. * testsuite/config/default.exp (SIZE, SIZEFLAGS): Define. * testsuite/gas/macros/app5.d, * testsuite/gas/macros/app5.s: New test. * testsuite/gas/macros/macros.exp: Run it.
2022-06-08asan: double free sb_killAlan Modra1-2/+1
oss-fuzz hits a flaky crash with a double-free. I think this is due to gas static state not being reinitialised between testcases, a bug with oss-fuzz not gas. Anyway, this patch should avoid the problem. * input-scrub.c (input_scrub_push): Move init of sb_index.. (input_scrub_reinit): ..to here.
2022-04-12gas: new_logical_line{,_flags}() can return "void"Jan Beulich1-15/+10
With the sole user of the return value gone, convert the return type to void. This in turn allows simplifying another construct, by moving it slightly later in the function.
2022-04-12gas: drop .appfile and .applineJan Beulich1-3/+1
These were used originally to represent "# <line> <file>" constructs inserted by (typically) compilers when pre-processing. Quite some time ago they were replaced by .linefile though. Since the original directives were never documented, we ought to be able to remove support for them. As a result in a number of case function parameter aren't used anymore and can hence be dropped.
2022-04-12gas: further adjust file/line handling for .macroJan Beulich1-9/+30
Commit 7992631e8c0b ("gas/Dwarf: improve debug info generation from .irp and alike blocks"), while dealing okay with actual assembly source files not using .file/.line and alike outside but not inside of .macro, has undue effects when the logical file/line pair was already overridden: Line numbers would continuously increment while processing the expanded macro, while the goal of the PR gas/16908 workaround is to keep the expansion associated with the line invoking the macro. However, as soon as enough state was overridden _inside_ the macro to cause as_where() to no longer fall back top as_where_physical(), honor this by resuming the bumping of the logical line number. Note that from_sb_is_expansion's initializer was 1 for an unknown reason. While renaming the variable and changing its type, also change the initializer to "expanding_none", which would have been "0" in the original code. Originally the initializer value itself wasn't ever used anyway (requiring sb_index != -1), as it necessarily had changed in input_scrub_include_sb() alongside setting sb_index to other than -1. Strictly speaking input_scrub_insert_line() perhaps shouldn't use expanding_none, yet none of the other enumerators fit there either. And then strictly speaking that function probably shouldn't exist in the first place. It's used only by tic54x.
2022-04-12gas: further adjust file/line handling for .irp and alikeJan Beulich1-1/+10
Commit 7992631e8c0b ("gas/Dwarf: improve debug info generation from .irp and alike blocks"), while dealing okay with actual assembly source files not using .file/.line and alike outside but not inside of .irp et al, has undue effects when the logical file/line pair was already overridden: Line numbers would continuously increment upon every iteration, thus potentially getting far off. Furthermore it left it to the user to actually insert .file/.line inside such constructs. Note though that before aforementioned change things weren't pretty either: Diagnostics (and debug info) would be associated with the directive terminating the iteration construct, rather than with the actual lines. Handle this automatically by simply latching the present line and then re-instating coordinates first thing on every iteration; note that the file can't change from what was previously pushed on the scrubber's state stack, and hence can be taken from there by using a new flavor of .linefile (which is far better memory-footprint-wise than recording the full path in the inserted directive). (This then leaves undisturbed any file/line control occurring in the body of the construct, as these will only be seen and processed afterwards.)
2022-03-23gas/Dwarf: improve debug info generation from .irp and alike blocksJan Beulich1-5/+4
Tying the bumping of the logical line number to reading from the original source file looks wrong: Upon finishing of the processing of an sb the original values will be restored anyway. Yet without bumping the line counter uses of .line inside e.g. an .irp construct won't have the intended effect: Such uses may be necessary to ensure proper debug info is emitted in particular when switching sections inside the .irp body, as dwarf2_gen_line_info() would bail without doing anything when it finds the line number unchanged from what it saw last.
2022-03-18ubsan: logical_input_line signed integer overflowAlan Modra1-8/+8
To avoid a completely useless fuzzing ubsan "bug" report, I decided to make logical_input_line unsigned. * input-scrub.c (logical_input_line): Make unsigned. (struct input_save): Here too. (input_scrub_reinit, input_scrub_close, bump_line_counters), (as_where): Adjust to suit.
2022-01-02Update year range in copyright notice of binutils filesAlan Modra1-1/+1
The result of running etc/update-copyright.py --this-year, fixing all the files whose mode is changed by the script, plus a build with --enable-maintainer-mode --enable-cgen-maint=yes, then checking out */po/*.pot which we don't update frequently. The copy of cgen was with commit d1dd5fcc38ead reverted as that commit breaks building of bfp opcodes files.
2021-11-18Add multibyte character warning option to the assembler.Nick Clifton1-0/+5
* as.c (parse_args): Add support for --multibyte-handling. * as.h (multibyte_handling): Declare. * app.c (scan_for_multibyte_characters): New function. (do_scrub_chars): Call the new function if multibyte warning is enabled. * input-scrub,c (input_scrub_next_buffer): Call the multibyte scanning function if multibyte warnings are enabled. * symbols.c (struct symbol_flags): Add multibyte_warned bit. (symbol_init): Call the multibyte scanning function if multibyte symbol warnings are enabled. (S_SET_SEGMENT): Likewise. * NEWS: Mention the new feature. * doc/as.texi: Document the new feature. * testsuite/gas/all/multibyte.s: New test source file. * testsuite/gas/all/multibyte1.d: New test driver file. * testsuite/gas/all/multibyte1.l: New test expected output. * testsuite/gas/all/multibyte2.d: New test driver file. * testsuite/gas/all/multibyte2.l: New test expected output. * testsuite/gas/all/gas.exp: Run the new tests.
2021-01-01Update year range in copyright notice of binutils filesAlan Modra1-1/+1
2020-01-01Update year range in copyright notice of binutils filesAlan Modra1-1/+1
2019-01-01Update year range in copyright notice of binutils filesAlan Modra1-1/+1
2018-01-03Update year range in copyright notice of binutils filesAlan Modra1-1/+1
2017-10-11Disable the inclusion of logical input files in the assembler listing output ↵Nick Clifton1-12/+20
unless high level source listing has been enabled. PR 21977 * listing.c (listing_newline): Use the name of the current physical input file, rather than the current logical input file, unless including high level source in the listing. * input-scrub.c (as_where_physical): New function. Returns the name of the current physical input file. * as.h: Add prototype for as_where_physical.
2017-01-02Update year range in copyright notice of all files.Alan Modra1-1/+1
2016-11-04Fix gas crash with unreasonably long linesNathan Sidwell1-43/+48
gas/ * input-scrub.c (partial_size): Make size_t. (buffer_length): Likewise. Adjust meaning. (struct input_save): Adjust partial_size type. (input_scrub_reinit): New. (input_scrub_push, input_scrub_begin): Use it. (input_scrub_next_buffer): Fix buffer extension logic. Only scan newly read buffer for newline.
2016-05-13use XNEW and related macros moreTrevor Saunders1-9/+9
Its a bit shorter and simpler than raw xmalloc. gas/ChangeLog: 2016-05-13 Trevor Saunders <tbsaunde+binutils@tbsaunde.org> * app.c (app_push): Use XNEW and related macros. * as.c (parse_args): Likewise. * cgen.c (make_right_shifted_expr): Likewise. (gas_cgen_tc_gen_reloc): Likewise. * config/bfin-defs.h: Likewise. * config/bfin-parse.y: Likewise. * config/obj-coff.c (stack_init): Likewise. (stack_push): Likewise. (coff_obj_symbol_new_hook): Likewise. (coff_obj_symbol_clone_hook): Likewise. (add_lineno): Likewise. (coff_frob_symbol): Likewise. * config/obj-elf.c (obj_elf_section_name): Likewise. (build_group_lists): Likewise. * config/obj-evax.c (evax_symbol_new_hook): Likewise. * config/obj-macho.c (obj_mach_o_indirect_symbol): Likewise. * config/tc-aarch64.c (insert_reg_alias): Likewise. (find_or_make_literal_pool): Likewise. (add_to_lit_pool): Likewise. (fill_instruction_hash_table): Likewise. * config/tc-alpha.c (load_expression): Likewise. (emit_jsrjmp): Likewise. (s_alpha_ent): Likewise. (s_alpha_end): Likewise. (s_alpha_linkage): Likewise. (md_begin): Likewise. (tc_gen_reloc): Likewise. * config/tc-arc.c (arc_insert_opcode): Likewise. (arc_extcorereg): Likewise. * config/tc-bfin.c: Likewise. * config/tc-cr16.c: Likewise. * config/tc-cris.c: Likewise. * config/tc-crx.c (preprocess_reglist): Likewise. * config/tc-d10v.c: Likewise. * config/tc-frv.c (frv_insert_vliw_insn): Likewise. (frv_tomcat_shuffle): Likewise. * config/tc-h8300.c: Likewise. * config/tc-i370.c (i370_macro): Likewise. * config/tc-i386.c (lex_got): Likewise. (md_parse_option): Likewise. * config/tc-ia64.c (alloc_record): Likewise. (set_imask): Likewise. (save_prologue_count): Likewise. (dot_proc): Likewise. (dot_endp): Likewise. (ia64_frob_label): Likewise. (add_qp_imply): Likewise. (add_qp_mutex): Likewise. (mark_resource): Likewise. (dot_alias): Likewise. * config/tc-m68hc11.c: Likewise. * config/tc-m68k.c (m68k_frob_label): Likewise. (s_save): Likewise. (mri_control_label): Likewise. (push_mri_control): Likewise. (build_mri_control_operand): Likewise. (s_mri_else): Likewise. (s_mri_break): Likewise. (s_mri_next): Likewise. (s_mri_for): Likewise. (s_mri_endw): Likewise. * config/tc-metag.c (create_mnemonic_htab): Likewise. * config/tc-microblaze.c: Likewise. * config/tc-mmix.c (s_loc): Likewise. * config/tc-nds32.c (nds32_relax_hint): Likewise. * config/tc-nios2.c (nios2_insn_reloc_new): Likewise. * config/tc-rl78.c: Likewise. * config/tc-rx.c (rx_include): Likewise. * config/tc-sh.c: Likewise. * config/tc-sh64.c (shmedia_frob_section_type): Likewise. * config/tc-sparc.c: Likewise. * config/tc-spu.c: Likewise. * config/tc-tic6x.c (static tic6x_unwind_info *tic6x_get_unwind): Likewise. (tic6x_start_unwind_section): Likewise. * config/tc-tilegx.c: Likewise. * config/tc-tilepro.c: Likewise. * config/tc-v850.c: Likewise. * config/tc-visium.c: Likewise. * config/tc-xgate.c: Likewise. * config/tc-xtensa.c (xtensa_translate_old_userreg_ops): Likewise. (new_resource_table): Likewise. (resize_resource_table): Likewise. (xtensa_create_trampoline_frag): Likewise. (xtensa_maybe_create_literal_pool_frag): Likewise. (cache_literal_section): Likewise. * config/xtensa-relax.c (append_transition): Likewise. (append_condition): Likewise. (append_value_condition): Likewise. (append_constant_value_condition): Likewise. (append_literal_op): Likewise. (append_label_op): Likewise. (append_constant_op): Likewise. (append_field_op): Likewise. (append_user_fn_field_op): Likewise. (enter_opname_n): Likewise. (enter_opname): Likewise. (split_string): Likewise. (parse_insn_templ): Likewise. (clone_req_or_option_list): Likewise. (clone_req_option_list): Likewise. (parse_option_cond): Likewise. (parse_insn_pattern): Likewise. (parse_insn_repl): Likewise. (build_transition): Likewise. (build_transition_table): Likewise. * dw2gencfi.c (alloc_fde_entry): Likewise. (alloc_cfi_insn_data): Likewise. (cfi_add_CFA_remember_state): Likewise. (dot_cfi_escape): Likewise. (dot_cfi_fde_data): Likewise. (select_cie_for_fde): Likewise. * dwarf2dbg.c (dwarf2_directive_loc): Likewise. * ecoff.c (ecoff_add_bytes): Likewise. (ecoff_build_debug): Likewise. * input-scrub.c (input_scrub_push): Likewise. (input_scrub_begin): Likewise. (input_scrub_next_buffer): Likewise. * itbl-ops.c (append_insns_as_macros): Likewise. (alloc_entry): Likewise. (alloc_field): Likewise. * listing.c (listing_newline): Likewise. (listing_listing): Likewise. * macro.c (get_any_string): Likewise. (delete_macro): Likewise. * stabs.c (generate_asm_file): Likewise. (stabs_generate_asm_lineno): Likewise. * subsegs.c (subseg_change): Likewise. (subseg_get): Likewise. * symbols.c (define_dollar_label): Likewise. (symbol_relc_make_sym): Likewise. * write.c (write_relocs): Likewise.
2016-02-22Add more const type qualifiers to GAS sources.Trevor Saunders1-18/+16
* 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-01-01Copyright update for binutilsAlan Modra1-1/+1
2015-07-22gas line buffer handlingAlan Modra1-55/+45
This fixes a segfault when macro definitions end on the last line of a file, and that line isn't properly terminated with a newline. gas used to throw away the last line in cases like this, whereas in other cases gas added the missing newline. So I've also made gas consistently provide a missing newline. PR gas/18687 * input-scrub.c (input_scrub_next_buffer): Rearrange and simplify loop. Don't drop lines at end of file lacking a newline, add a newline instead. Ensure partial_size is zero whenever partial_where is NULL. Adjust buffer size for extra char. (input_scrub_push, input_scrub_begin): Adjust buffer size here too.
2015-01-02ChangeLog rotatation and copyright year updateAlan Modra1-1/+1
2014-11-04Don't use register keywordAlan Modra1-3/+3
* expr.c (expr_symbol_where): Don't use register keyword. * app.c (app_push, app_pop, do_scrub_chars): Likewise. * ecoff.c (add_string, add_ecoff_symbol, add_aux_sym_symint, add_aux_sym_rndx, add_aux_sym_tir, add_procedure, add_file, ecoff_build_lineno, ecoff_setup_ext, allocate_cluster. allocate_scope, allocate_vlinks, allocate_shash, allocate_thash, allocate_tag, allocate_forward, allocate_thead, allocate_lineno_list): Likewise. * frags.c (frag_more, frag_var, frag_variant, frag_wane): Likewise. * input-file.c (input_file_push, input_file_pop): Likewise. * input-scrub.c (input_scrub_push, input_scrub_next_buffer): Likewise. * subsegs.c (subseg_change): Likewise. * symbols.c (colon, symbol_table_insert, symbol_find_or_make) (dollar_label_name, fb_label_name): Likewise. * write.c (relax_align): Likewise. * config/tc-alpha.c (s_alpha_pdesc): Likewise. * config/tc-bfin.c (bfin_s_bss): Likewise. * config/tc-i860.c (md_estimate_size_before_relax): Likewise. * config/tc-m68hc11.c (md_convert_frag): Likewise. * config/tc-m68k.c (m68k_ip, crack_operand): Likewise. (md_convert_frag_1, s_even): Likewise. * config/tc-mips.c (mips_clear_insn_labels): Likewise. * config/tc-mn10200.c (md_begin): Likewise. * config/tc-s390.c (s390_setup_opcodes, md_begin): Likewise. * config/tc-sh.c (sh_elf_cons): Likewise. * config/tc-tic4x.c (tic4x_cons, tic4x_stringer): Likewise. * config/m68k-parse.y (m68k_reg_parse): Likewise. Convert from K&R. (yylex, m68k_ip_op, yyerror): Convert from K&R.
2014-03-05Update copyright yearsAlan Modra1-3/+1
2012-06-09Allocate sufficient space for string bufferH.J. Lu1-4/+7
* input-scrub.c (input_scrub_include_sb): Use sb_build to allocate sufficient space for from_sb. Use sb_terminate to terminate string. * read.c (read_a_source_file): Use sb_build to allocate sufficient space and replace sb_add_string with sb_add_buffer. (s_macro): Likewise. (input_scrub_insert_line): Likewise. (s_irp): Use sb_build to allocate sufficient space. (do_repeat): Use sb_build to allocate sufficient space for many. * sb.c (sb_build): Remove static. * sb.h (sb_build): New prototype.
2012-06-07 PR gas/14201Alan Modra1-8/+7
* sb.h (sb_max_power_two): Delete. (struct sb): Delete "item" and "pot". Make "len" a size_t. Add "max". (sb_element): Delete. (sb_add_char, sb_add_buffer, sb_skip_comma, sb_skip_write): Update prototypes. * sb.c (string_count, free_list): Delete. (sb_build, sb_kill, sb_check): Rewrite. (scrub_from_sb, sb_add_char, sb_add_string, sb_add_buffer, sb_skip_white, sb_skip_comma): Replace assorted int params, vars and return types with size_t. * input-scrub.c: Likewise. * macro.c: Likewise. * macro.h: Likewise. * as.c: Likewise. * as.h: Likewise. * input-file.h: Likewise. * input-file.c: Likewise. * read.c: Likewise. * app.c: ..or ptrdiff_t. * input-file.c (input_file_get): Use ferror. (input_file_give_next_buffer): Use input_file_get.
2011-03-18gas/Alan Modra1-5/+6
* input-scrub.c (line_numberT): Delete. (input_scrub_close): Reset line counters. * messages.c (as_show_where): Don't print invalid line number. (as_warn_internal, as_bad_internal): Likewise. gas/testsuite/ * gas/elf/bad-size.err: Adjust expected error. * gas/i386/bad-size.warn: Likewise. * gas/i386/inval-equ-2.l: Likewise. * gas/symver/symver2.l: Likewise.
2011-02-28ChangeLog binutils/Kai Tietz1-1/+2
2011-02-28 Kai Tietz <kai.tietz@onevision.com> * debug.c (debug_start_source): Use filename_(n)cmp. * ieee.c (ieee_finish_compilation_unit): Likewise. (ieee_lineno): Likewise. * nlmconv.c (main): Likewise. * objcopy.c (strip_main): Likewise. (copy_main): Likewise. * objdump.c (show_line): Likewise. (dump_reloc_set): Likewise. * srconv.c (main): Likewise. * wrstabs.c (stab_lineno): Likewise. ChangeLog gas/ 2011-02-28 Kai Tietz <kai.tietz@onevision.com> * depend.c (register_dependency): Use filename_(n)cmp. * dwarf2dbg.c (get_filenum): Likewise. * ecoff.c (add_file): Likewise. (ecoff_generate_asm_lineno): Likewise. * input-scrub.c (new_logical_line_flags): Likewise. * listing.c (file_info): Likewise. (listing_newline): Likewise. * remap.c (remap_debug_filename): Likewise. * stabs.c (generate_asm_file): Likewise. (stabs_generate_asm_lineno): Likewise.
2010-03-30Use memmove to copy overlap memory.H.J. Lu1-2/+2
2010-03-30 H.J. Lu <hongjiu.lu@intel.com> PR gas/11456 * input-scrub.c (input_scrub_next_buffer): Use memmove instead of memcpy to copy overlap memory.
2009-09-11 * po/bfd.pot: Updated by the Translation project.Nick Clifton1-6/+8
* po/binutils.pot: Updated by the Translation project. * po/gold.pot: Updated by the Translation project. * po/gold.pot: Updated by the Translation project. * po/gprof.pot: Updated by the Translation project. * po/sv.po: Updated Swedish translation. * po/ld.pot: Updated by the Translation project. * po/fi.po: Updated Finnish translation. * po/ld.pot: Updated by the Translation project. * po/fi.po: Updated Finnish translation. Updated sources to compile cleanly with -Wc++-compat: * basic_blocks.c: Add casts. * cg_dfn.c: Add cast. * corefile.c: Add casts. * gmon_io.c: Add casts. * hist.c: Add cast. * source.c: Add cast. * sym_ids.c (struct match): Moved to top level. Updated soruces in ld/* to compile cleanly with -Wc++-compat: * ld.h (enum endian_enum,enum symbolic_enum,enum dynamic_list_enum): Move to top level. * ldcref.c: Add casts. * ldctor.c: Add casts. * ldexp.c * ldexp.h (enum node_tree_enum,enum phase_enum): Move to top level. * ldlang.c: Add casts. (lang_insert_orphan): Use enum name instead of integer. * ldlang.h (enum statement_enum): Move to top level. * ldmain.c: Add casts. * ldwrite.c: Add casts. * lexsup.c: Add casts. (enum control_enum): Move to top level. * mri.c: Add casts. (mri_draw_tree): Use enum name instead of integer. Updated sources to compile cleanly with -Wc++-compat: * basic_blocks.c: Add casts. * cg_dfn.c: Add cast. * corefile.c: Add casts. * gmon_io.c: Add casts. * hist.c: Add cast. * source.c: Add cast. * sym_ids.c (struct match): Moved to top level. * as.c (main): Call dwarf2_init. * config/obj-elf.c (struct group_list): New field. (build_group_lists): Use hash lookup. (free_section_idx): New function. (elf_frob_file): Adjust. * dwarf2dbg.c (all_segs_hash, last_seg_ptr): New variables. (get_line_subseg): Adjust. (dwarf2_init): New function. * dwarf2dbg.h (dwarf2_init): New declaration.
2009-09-02update copyright datesAlan Modra1-1/+1
2008-11-12 PR gas/7025Hans-Peter Nilsson1-0/+6
* input-scrub.c (input_scrub_include_sb): Make the position after the input have defined contents, a 0 character.
2007-07-03Switch to GPLv3Nick Clifton1-1/+1
2007-03-09* app.c (do_scrub_chars): Turn #<line>"file"flags into .linefile.Alexandre Oliva1-5/+33
* as.h (new_logical_line_flags): New. * input-scrub.c (new_logical_line): Turned into wrapper for... (new_logical_line_flags): this. Handle flags. * read.c (potable): Add linefile. Adjust appline argument. (s_app_file): Fake .appfiles no more. (s_app_line): For .linefile, accept file name and flags.
2006-10-16 * input-scrub.c (input_scrub_next_buffer): Use TC_EOL_IN_INSNBernd Schmidt1-3/+10
in addition to testing for '\n'. (TC_EOL_IN_INSN): Provide a default definition if necessary.
2006-06-07remove some duplicate #include's.Alan Modra1-2/+1
2005-05-18include/elf:Zack Weinberg1-1/+1
* arm.h: Import complete list of official relocation names and numbers from AAELF. Define FAKE_RELOCs for old names. Remove a few old names no longer used anywhere. bfd: * elf32-arm.c: Wherever possible, use official reloc names from AAELF. (elf32_arm_howto_table, elf32_arm_tls_gd32_howto) (elf32_arm_tls_ldo32_howto, elf32_arm_tls_ldm32_howto) (elf32_arm_tls_le32_howto, elf32_arm_tls_ie32_howto) (elf32_arm_vtinherit_howto, elf32_arm_vtentry_howto) (elf32_arm_pc11_howto, elf32_arm_thm_pc9_howto, elf32_arm_got_prel) (elf32_arm_r_howto): Replace with elf32_arm_howto_table_1, elf32_arm_howto_table_2, and elf32_arm_howto_table_3. Add many new relocations from AAELF. (elf32_arm_howto_from_type): Update to match. (elf32_arm_reloc_map): Add entries for R_ARM_THM_JUMP24, R_ARM_THM_JUMP11, R_ARM_THM_JUMP19, R_ARM_THM_JUMP8, R_ARM_THM_JUMP6, R_ARM_GNU_VTINHERIT, and R_ARM_GNU_VTENTRY. (elf32_arm_reloc_type_lookup): Use elf32_arm_howto_from_type. (elf32_arm_final_link_relocate): Add support for R_ARM_THM_JUMP24, R_ARM_THM_JUMP19, R_ARM_THM_JUMP6. Remove case entries redundant with default. * reloc.c: Reorganize ARM relocations. Add Thumb assembler-internal relocations BFD_RELOC_ARM_T32_OFFSET_U8, BFD_RELOC_ARM_T32_OFFSET_IMM, BFD_RELOC_ARM_T32_IMMEDIATE. Add visible relocations BFD_RELOC_THUMB_PCREL_BRANCH7, BFD_RELOC_THUMB_BRANCH20, BFD_RELOC_THUMB_BRANCH25. Delete unused relocations BFD_RELOC_ARM_GOT12, BFD_RELOC_ARM_COPY. * bfd-in2.h, libbfd.h: Regenerate. opcodes: * arm-dis.c (thumb_opcodes): Add disassembly for V6T2 16-bit instructions. Adjust disassembly of some opcodes to match unified syntax. (thumb32_opcodes): New table. (print_insn_thumb): Rename print_insn_thumb16; don't handle two-halfword branches here. (print_insn_thumb32): New function. (print_insn): Choose among print_insn_arm, print_insn_thumb16, and print_insn_thumb32. Be consistent about order of halfwords when printing 32-bit instructions. gas: * hash.c (hash_lookup): Add len parameter. All callers changed. (hash_find_n): New interface. * hash.h: Prototype hash_find_n. * sb.c: Include as.h. (scrub_from_sb, sb_to_scrub, scrub_position): New statics. (sb_scrub_and_add_sb): New interface. * sb.h: Prototype sb_scrub_and_add_sb. * input-scrub.c (input_scrub_include_sb): Use sb_scrub_and_add_sb. * config/tc-arm.h (TC_FORCE_RELOCATION_LOCAL): Remove reference to BFD_RELOC_ARM_GOT12 which is never generated. * config/tc-arm.c: Rewrite, adding Thumb-2 support. gas/testsuite: * gas/arm/arm.exp: Convert all existing "gas_test" tests to "run_dump_test" tests. Run more tests unconditionally. Run new tests. * gas/arm/arch4t.s, gas/arm/arch6zk.s, gas/arm/arm3.s, gas/arm/arm6.s * gas/arm/arm7dm.s, gas/arm/bignum1.s, gas/arm/float.s * gas/arm/immed.s, gas/arm/iwmmxt.s, gas/arm/offset.s, gas/arm/thumb.s: Adjust to work as a dump test. * gas/arm/arch4t.d, gas/arm/arch6zk.d, gas/arm/arm3.d, gas/arm/arm6.d * gas/arm/arm7dm.d, gas/arm/bignum1.d, gas/arm/float.d * gas/arm/immed.d, gas/arm/iwmmxt.d, gas/arm/offset.d, gas/arm/thumb.d: New files. * gas/arm/armv1-bad.l, gas/arm/armv1-bad.s: Remove tests for diagnostics that don't happen in the first pass anymore. * gas/arm/iwmmxt-bad.l, gas/arm/r15-bad.l, gas/arm/req.l * gas/arm/vfp-bad.l: Update expected diagnostics. * gas/arm/pic.d: Update expected reloc name. * gas/arm/thumbv6.d: CPY no longer appears in disassembly. * gas/arm/r15-bad.s: Avoid two-argument mul. * gas/arm/req.s: Adjust comments. * gas/arm/maverick.d, gas/arm/maverick.s: Avoid inappropriate use of PC. * gas/arm/macro-1.d, gas/arm/macro1.s * gas/arm/t16-bad.l, gas/arm/t16-bad.s * gas/arm/tcompat.d, gas/arm/tcompat.s * gas/arm/tcompat2.d, gas/arm/tcompat2.s * gas/arm/thumb32.d, gas/arm/thumb32.s New test pair. ld/testsuite: * ld-arm/mixed-app.d: Adjust expected disassembly a little.
2005-05-05Update the address and phone number of the FSFNick Clifton1-2/+2
2005-04-29 * Makefile.am (GAS_CFILES): Remove bignum-copy.c.Ben Elliston1-37/+0
(GENERIC_OBJS): Likewise, remove bignum-copy.o. (bignum-copy.o): Remove. * Makefile.in: Regenerate. * makefile.vms (OBJS): Remove bignum-copy.obj. * symbols.h (local_symbol_make): Remove declaration. (verify_symbol_chain_2): Likewise. * symbols.c (local_symbol_make): Make static. (max_indent_level): Likewise. (verify_symbol_chain_2): Remove. * macro.c (macro_hash): Make static. * messages.c (fprint_value): Remove. * read.h (get_absolute_expr): Remove. (emit_leb128_expr): Likewise. (do_s_func): Likewise. * read.c (do_s_func): Make static. (emit_leb128_expr): Likewise. (get_absolute_expr): Likewise. * as.h (as_howmuch): Remove declaration. (fprint_value): Likewise. * as.c (myname): Make static. * input-scrub.c (as_howmuch): Remove. (as_1_char): Likewise. * input-file.h (input_file_is_open): Remove. * input-file.c (input_file_is_open): Likewise. * expr.h (expr_build_unary): Remove declaration. (expr_build_binary): Likewise. * expr.c (expr_build_unary): Remove. (expr_build_binary): Likewise. * hash.h (hash_replace): Remove declaration. (hash_delete): Likewise. * hash.c (hash_replace): Remove. (hash_delete): Likewise. * bignum-copy.c (bignum_copy): Move from here .. * config/tc-vax.c (bignum_copy): .. to here. * bignum.h (LOG_TO_BASE_2_OF_10): Remove. (bignum_copy): Remove extern declaration. * sb.h (string_count): Remove extern declaration. (sb_build, sb_add_buffer, sb_print, sb_print_at): Likewise. (sb_name): Likewise. * sb.c (dsize): Replace preprocessor macro with static int. (string_count): Make static. (sb_build, sb_add_buffer, sb_print, sb_print_at): Likewise. (sb_name): Likewise. * config/obj-coff.c (dim_index): Make static. * config/tc-i386.c (GOT_symbol): Likewise. (output_invalid_buf): Likewise. * doc/internals.texi (Warning and error messages): Remove the prototype for fprint_value.
2005-03-03update copyright datesAlan Modra1-1/+1
2003-11-24 * hash.c: Convert to ISO-C.Kazu Hirata1-34/+19
* hash.h: Likewise. * input-file.c: Likewise. * input-file.h: Likewise. * input-scrub.c: Likewise. * itbl-ops.c: Likewise. * itbl-ops.h: Likewise.
2003-10-27 * ChangeLog: Fix typos.Kazu Hirata1-1/+1
* ChangeLog-9295: Likewise. * as.c: Fix comment typos. * as.h: Likewise. * atof-generic.c: Likewise. * bit_fix.h: Likewise. * frags.h: Likewise. * hash.c: Likewise. * input-file.c: Likewise. * input-scrub.c: Likewise. * itbl-ops.c: Likewise. * itbl-parse.y: Likewise. * listing.c: Likewise. * macro.h: Likewise. * read.c: Likewise. * sb.c: Likewise. * sb.h: Likewise. * symbols.c: Likewise. * symbols.h: Likewise.
2001-08-01 * read.c: Standardize error/warning messages - don't capitalise, noAlan Modra1-1/+1
final period or newline, don't say "ignored" or "zero assumed" for as_bad messages. In some cases, change the wording to that used elsewhere for similar messages. * app.c, as.c, atof-generic.c, cgen.c, cond.c, depend.c, dwarf2dbg.c, ecoff.c, expr.c, frags.c, input-file.c, input-scrub.c, listing.c, output-file.c, stabs.c, subsegs.c, symbols.c, write.c: Likewise. * ecoff.c (ecoff_directive_end): Test for missing name by comparing input line pointers rather than reading string. (ecoff_directive_ent): Likewise. * read.c (s_set): Likewise. (s_align): Report a warning rather than an error for alignment too large. (s_comm): Check for missing symbol name. (s_lcomm_internal): Likewise. (s_lsym): Likewise. (s_globl): Use is_end_of_line instead of looking for '\n'. (s_lcomm_internal): Likewise. (ignore_rest_of_line): Report a warning rather than an error.