aboutsummaryrefslogtreecommitdiff
path: root/gas/macro.c
AgeCommit message (Collapse)AuthorFilesLines
2016-01-01Copyright update for binutilsAlan Modra1-1/+1
2015-01-02ChangeLog rotatation and copyright year updateAlan Modra1-1/+1
2014-06-17This fixes a bug whereby #line directives inside a macro would be ignored,Chris Metcalf1-0/+22
thus resulting in bad line debug information. PR gas/16908 * macro.c (buffer_and_nest): Honour #line directives inside macros.
2014-03-05Update copyright yearsAlan Modra1-2/+1
2013-01-10gas/Roland McGrath1-13/+13
* hash.c (hash_new_sized): Make it global. * hash.h: Declare it. * macro.c (define_macro): Use hash_new_sized instead of hash_new, pass a small size.
2012-06-07 PR gas/14201Alan Modra1-34/+34
* 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-30 * macro.c (get_any_string): Free malloced br_buf.Nick Clifton1-8/+12
(do_formals): Free 'formal'.
2010-08-18 * macro.c (sub_actual): Add back ampersand suffix when noAlan Modra1-3/+4
substitution. (macro_expand_body): Correct comment.
2010-07-23 PR gas/11834Alan Modra1-3/+7
* macro.c (macro_expand): Recover gracefully from named args that don't match params.
2010-04-20 PR gas/11507Nick Clifton1-1/+3
* macro.c (macro_expand_body): Do not treat LOCAL as a keyword in altmacro mode if found inside a quoted string. * gas/macros/altmacro.s: New test. * gas/macros/altmacro.d: Expected output.
2009-12-11Add -Wshadow to the gcc command line options used when compiling the binutils.Nick Clifton1-5/+5
Fix up all warnings generated by the addition of this switch.
2009-10-15 PR gas/1491Alan Modra1-37/+28
gas/ * macro.c: Delete unnecessary function declarations. (buffer_and_nest): Support multiple labels per line for LABELS_WITHOUT_COLONS targets if the labels do have colons. (free_macro): Move so that we don't need forward declaration. * read.c (read_a_source_file): Take a copy of macro expansion line before we trim labels. * listing.c (listing_newline): Adjust stdin line save for input_line_pointer still at start of line. gas/testsuite/ * gas/macros/dot.s: Don't start macro invocations is first column. * gas/macros/dot.l: Update. * gas/macros/macros.exp: Run dot test on more targets.
2009-09-11 * po/bfd.pot: Updated by the Translation project.Nick Clifton1-4/+4
* 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.
2008-08-12Banish PARAMS and PTR. Convert to ISO C.Alan Modra1-1/+1
Delete unnecessary forward declarations.
2008-08-11 PR 6575Alan Modra1-5/+7
* hash.c: Expand PTR to void *. (hash_delete): Add "freeme" parameter. Call obstack_free. * hash.h: Expand PTR to void *. (hash_delete): Update prototype. * macro.c (macro_expand_body): hash_delete LOCALs from formal_hash. * config/tc-tic54x.c (tic54x_remove_local_label): Update hash_delete call. (subsym_substitute): Likewise. * doc/internals.texi (hash_delete): Update.
2007-07-03Switch to GPLv3Nick Clifton1-2/+2
2007-01-12PR gas/3856Nick Clifton1-2/+12
* macro.c (expand_irp): Do not ignore spaces inside quoted strings.
2006-06-07remove some duplicate #include's.Alan Modra1-37/+1
2006-05-01 * listing.c (listing_listing): Remove useless loop.Ben Elliston1-3/+0
* macro.c (macro_expand): Remove is_positional local variable. * read.c (s_comm_internal): Simplify `if' condition 1 || x -> 1 and simplify surrounding expressions, where possible. (assign_symbol): Likewise. (s_weakref): Likewise. * symbols.c (colon): Likewise.
2006-02-28gas/Jan Beulich1-4/+3
2006-02-28 Jan Beulich <jbeulich@novell.com> * macro.c (get_any_string): Don't insert quotes for <>-quoted input. gas/testsuite/ 2006-02-28 Jan Beulich <jbeulich@novell.com> * gas/all/altmacro.s: Adjust. * gas/all/altmac2.s: Adjust.
2006-02-28gas/Jan Beulich1-37/+40
2006-02-28 Jan Beulich <jbeulich@novell.com> PR/1070 * macro.c (getstring): Don't treat parentheses special anymore. (get_any_string): Don't consider '(' and ')' as quoting anymore. Special-case '(', ')', '[', and ']' when dealing with non-quoting characters. gas/testsuite/ 2006-02-28 Jan Beulich <jbeulich@novell.com> * gas/macros/paren[sd]: New. * gas/macros/macros.exp: Run new test.
2005-11-07 * macro.c (buffer_and_nest): Skip labels regardless ofAlan Modra1-36/+33
NO_PSEUDO_DOT and flag_m68k_mri.
2005-08-09PR 1070Nick Clifton1-5/+26
* macro.c (getstring): Do not treat round parentheses exactly the same as angle brackets - the parentheses need to be preserved and passed on to the macro processing code.
2005-08-08PR 1070Nick Clifton1-8/+16
* macro.c (getstring): Treat round parentheses in the same way as angle brackets. (get_any_string): Likewise.
2005-05-10gas/Jan Beulich1-23/+14
2005-05-10 Jan Beulich <jbeulich@novell.com> * macro.c (get_any_string): Remove the two last parameters. Replace references to the former expand parameter by using macro_alternate. Simplify loop condition for checking for end-of-string. (get_string): Remove redunant call to sb_skip_white. (do_formals): Remove two last arguments to get_any_string. (macro_expand): Likewise. (expand_irp): Likewise.
2005-05-06gas/Jan Beulich1-69/+143
2005-05-06 Jan Beulich <jbeulich@novell.com> * macro.c (new_formal, del_formal): New. (do_formals): Use new_formal. Check for and parse qualifier. Warn if required argument has default value. Stop looking for more formal when there was a vararg one. (macro_expand_body): Use new_formal and del_formal. (macro_expand): Likewise. Initialize local variable err. Don't return immediately when encountering an error. Warn when keyword argument already had a value assigned. Eliminate duplicate clearing of argument value. When current positional argument matches parameter of vararg type, assign to it all the remaining arguments. Issue error when required parameter does not have value. (free_macro): Use del_formal. (expand_irp): Initialize formal type. Free buffers associated with formal prior to returning. * macro.h (struct formal_struct): Add new field 'type' with new enumeration type 'formal_type'. * doc/as.texinfo: Document macro parameter qualifiers. * NEWS: Mention new functionality. gas/testsuite/ 2005-05-06 Jan Beulich <jbeulich@novell.com> * gas/macros/badarg.s: Add check for bad qualifier specification. * gas/macros/badarg.l: Adjust. * gas/macros/vararg.[sd]: New. * gas/macros/macros.exp: Run new test.
2005-05-05Update the address and phone number of the FSFNick Clifton1-2/+2
2005-05-03* config/obj-ecoff.c (ecoff_frob_file_before_fix): Fix invocations of ↵Nick Clifton1-1/+1
bfd_section_list... macros. * config/tc-mmix.c (mmix_frob_file): Likewise. * config/tc-xtensa.c (xtensa_remove_section): Likewise. (xtensa_insert_section): Likewise. * macro.c (macro_hash): Remove static. * macro.h (macro_hash): Provide an external declaration.
2005-04-29 * Makefile.am (GAS_CFILES): Remove bignum-copy.c.Ben Elliston1-1/+1
(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-04-25gas/Jan Beulich1-55/+93
2005-04-25 Jan Beulich <jbeulich@novell.com> * macro.c (macro_expand_body): Replace locals indicator parameters with actual macro_entry. New local variables macro_line and err. Don't return when encountering an error, just record the fact. Detect local symbol name colliding with parameter. Track line number inside of macro expansion. (do_formals): Move local variable name to wider scope. Check parameter of the same name doesn't already exist. In MRI mode, also check it doesn't collide with the argument count pseudo-parameter). (define_macro): Add file and line number parameters. Remove local variable namestr. New local variable error. Initialize macro_entry members file, line, and name. Don't return when encountering an error, just record the fact. Use %s in some diagnostics for read.c to insert the macro name. Free macro_entry on error. (macro_expand): Pass macro_entry to macro_epand_body. Don't return when encountering an error, just record the fact. (expand_irp): Don't return when encountering an error, just record the fact. * macro.h (macro_struct): New members name, file, and line. (define_macro): Add file and line number parameters. * read.c (s_macro): Pass file and line to define_macro. Tag warning regarding pseudo-op redefinition with the file/line that macro definition started at. gas/testsuite/ 2005-04-25 Jan Beulich <jbeulich@novell.com> * gas/macros/badarg.s: Add tests for collisions between/among macro parameters and local symbols. * gas/macros/badarg.l: Adjust.
2005-04-18gas/Jan Beulich1-3/+43
2005-04-18 Jan Beulich <jbeulich@novell.com> * macro.c (free_token): New, freeing all the memory associated with a macro. (do_formals): Move initializers to ... (define_macro): ... here. (delete_macro): Convert passed in name to lower case. Warn when purging macro that doesn't exist. Use hash_jam instead of hash_delete. gas/testsuite/ 2005-04-18 Jan Beulich <jbeulich@novell.com> * gas/macros/purge.[ls]: New. * gas/macros/macros.exp: Run new test.
2005-04-11gas/Jan Beulich1-36/+52
2005-04-11 Jan Beulich <jbeulich@novell.com> * NEWS: Mention these changes and their effects. * macro.c (get_token): Use is_name_beginner/is_part_of_name/ is_name_ender. (check_macro): Likewise. (buffer_and_nest): Likewise. Permit multiple labels. Don't discard labels together with the closing pseudo-op. (macro_expand_body): Adjust comment. Range-check input before use. Adjust mis-spelled diagnostic. Use is_name_beginner. * read.c (try_macro): New. (read_a_source_file): New static variable last_eol. Don't list macro expansion lines more than once. Call try_macro. (s_macro): Set section of line_label to absolute instead of undefined. * doc/as.texinfo: Add information on the caveats of these changes. gas/testsuite/ 2005-04-11 Jan Beulich <jbeulich@novell.com> * gas/macros/dot.[ls]: New. * gas/macros/macros.exp: Run new test.
2005-03-03update copyright datesAlan Modra1-2/+2
2005-01-31gas/Jan Beulich1-13/+26
2005-01-31 Jan Beulich <jbeulich@novell.com> * macro.c (buffer_and_nest): Allow 'from' being NULL; handle anything that can end with .endr in that case. Make requiring/permitting pseudo-ops without leading dot closer to the logic in read.c serving the same purpose. (expand_irp): Don't pass a mnemonic to buffer_and_nest as it will be ignored. gas/testsuite/ 2005-01-31 Jan Beulich <jbeulich@novell.com> * gas/macros/repeat.[ds]: New. * gas/macros/macros.exp: Run new test.
2005-01-31gas/Jan Beulich1-14/+35
2005-01-31 Jan Beulich <jbeulich@novell.com> * macro.c (do_formals): Adjust to no longer accept empty parameter names. (define_macro): Adjust to no longer accept empty macro name, garbage following the parameters, or macros that were previously defined. * read.c (s_bad_end): Declare. (potable): Add endm. Handler for endr and endm is s_bad_end. (s_bad_end): Rename from s_bad_endr. Adjust to handle both .endm and .endr. * read.h (s_bad_endr): Remove. gas/testsuite/ 2005-01-31 Jan Beulich <jbeulich@novell.com> * gas/macros/badarg.[ls]: New. * gas/macros/end.[ls]: New. * gas/macros/redef.[ls]: New. * gas/macros/macros.exp (run_list_test): Copy from elsewhere. Run new tests.
2004-10-07For ELF targets use .LL rather than LL as the prefix for symbol names generatedNick Clifton1-2/+3
from the LOCAL macro directive.
2004-08-16(macro_set_alternate): Use ISO C90 formatting.Nick Clifton1-2/+1
2004-08-13Add and handle new --alternate command line option.Nick Clifton1-0/+9
2003-11-24 * listing.c: Convert to ISO-C.Kazu Hirata1-83/+30
* listing.h: Likewise. * macro.c: Likewise. * macro.h: Likewise.
2003-06-02 * macro.c (sub_actual): Don't lose string if it turns out thatAlan Modra1-0/+1
&string wasn't an arg.
2003-03-13(buffer_and_nest): Store more to sb instead of '\n'.Nick Clifton1-2/+2
(get_line_sb): Return end of line character or '\n' if it is zero or non-existent.
2003-01-03 * configure.in: Add iq2000-elf target.Stan Cox1-2/+2
* configure: Regenerate. * config/tc-iq2000.c: New file. * config/tc-iq2000.h: Likewise.
2002-12-02Remove GASP.Nick Clifton1-44/+20
2002-11-11 * macro.c (get_any_string): Correct logic for not going beyond endHans-Peter Nilsson1-1/+1
of in->ptr[].
2002-05-03 * as.h: Fix formatting.Kazu Hirata1-24/+24
* cgen.c: Likewise. * cgen.h: Likewise. * dwarf2dbg.c: Likewise. * frags.h: Likewise. * gasp.c: Likewise. * macro.c: Likewise. * read.c: Likewise. * stabs.c: Likewise. * symbols.c: Likewise.
2002-01-17Add no-c-format comment to prevent confusion when translating string.Nick Clifton1-1/+2
2001-09-19Locale changes from Bruno Haible <haible@clisp.cons.org>.H.J. Lu1-18/+15
2001-08-10 * as.h (alloca): Don't declare if __GNUC__. Remove an old comment.Alan Modra1-11/+5
Comment indentation of #pragma. * macro.c (alloca): Likewise.
2001-06-12Fix m68k/mri mode problems.Nick Clifton1-15/+23
2001-03-08Fix copyright noticesNick Clifton1-1/+1