Commit Graph

68 Commits

Author SHA1 Message Date
Ben Elliston 7b3835172a * expr.c (expr): Replace O_add case in switch (op_left) explaining
why it can never occur.
2006-10-24 18:10:57 +00:00
Alan Modra ebd1c8757c remove some duplicate #include's. 2006-06-07 11:27:58 +00:00
Ben Elliston 8c9f705ebb * expr.c (operand): Remove `if (0 && ..)' statement and
subsequently unused target_op label.  Collapse `if (1 || ..)'
        statement.
        * app.c (do_scrub_chars): Remove unused case 0, as it is handled
        separately above the switch.
2006-05-09 04:54:32 +00:00
Alan Modra 9963077898 PR 997
* frags.c (frag_offset_fixed_p): New function.
	* frags.h (frag_offset_fixed_p): Declare.
	* expr.c (expr): Use frag_offset_fixed_p when simplifying subtraction.
	(resolve_expression): Likewise.
2006-04-04 08:04:57 +00:00
Jan Beulich 2e1e12b1f4 gas/
2005-12-22  Jan Beulich  <jbeulich@novell.com>

	* symbols.h (snapshot_symbol): First parameter is now pointer
	to pointer to symbolS.
	* symbols.c (snapshot_symbol): Likewise. Store resulting symbol
	there. Use symbol_equated_p.
	* expr.c (resolve_expression): Change first argument to
	snapshot_symbol. Track possibly changed add_symbol consistently
	across function. Resolve more special cases with known result.
	Also update final_val when replacing add_symbol.

gas/testsuite/
2005-12-22  Jan Beulich  <jbeulich@novell.com>

	* gas/all/cond.s: Also check .if works on equates to undefined
	when the expression value can be known without knowing the
	value of the symbol.
	* gas/all/cond.l: Adjust.
	* gas/i386/equ.s: Also check .if works on (equates to)
	registers when the expression value can be known without
	knowing the value of the register.
	* gas/i386/equ.e: Adjust.
2005-12-22 17:05:40 +00:00
Nick Clifton 4fa6945e82 * expr.c (operand <case '$'>): Use DOLLAR_AMBIGU rather than flag_mri_m68k
as condition for parsing the '$' as a prefix.
* as.h (DOLLAR_AMBIGU): Define if needed.
2005-11-08 15:48:26 +00:00
Alan Modra fb7ccfc159 * expr.c (op_encoding): Map '=' to O_SINGLE_EQ, if defined.
* config/tc-z80.h: Define O_SINGLE_EQ as O_eq.
2005-11-07 02:15:47 +00:00
Alan Modra fee9cbc776 * expr.c (integer_constant): Match only 'B' as binary suffix if
NUMBERS_WITH_SUFFIX and LOCAL_LABELS_FB.  Allow both 'b' and 'B'
        otherwise.
2005-11-06 23:04:10 +00:00
Nick Clifton 9497f5ac6b This adjusts equate handling by
- allowing true forward references (which will always assume the referenced
  symbols have at the point of use) through the new .eqv pseudo-op and the
  new == operator
- disallowing changing .equiv-generated equates (so that the protection this
  provides is both forward and backward)
- snapshotting equates when their value gets changed so that previous uses
  don't get affected by the new value.
- allowing expressions in places where absolute expressions (or register
  names) are needed which were not completely resolvable at the point of
  their definition but which are fully resolvable at the point of use

In addition it fixes PR/288.
2005-10-11 11:16:17 +00:00
Nick Clifton 723a84724a * expr.c (operator): Allow "!=" as a synonym for "<>".
* doc/as.texinfo (Infix Op): Mention "!=".
2005-10-10 15:32:44 +00:00
Nick Clifton 4b4da1607a Update the address and phone number of the FSF 2005-05-05 09:13:19 +00:00
Ben Elliston 87c245cccc * Makefile.am (GAS_CFILES): Remove bignum-copy.c.
(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-29 00:22:29 +00:00
Jan Beulich 43c3ab55ac gas/
2005-03-15  Jan Beulich  <jbeulich@novell.com>

	* expr.c (operand): Merge handling of unary + into that for unary
	-, !, and ~.
2005-03-15 15:41:31 +00:00
Nick Clifton fbacee5b43 Remove redundant code enclosed by #ifdef RELAX_PAREN_GROUPING....#endif. 2005-03-03 17:22:12 +00:00
Alan Modra 9d0e75cb1b * expr.c (integer_constant): Remove TARGET_WORD_SIZE hack.
* config/tc-m68k.h (TARGET_WORD_SIZE): Delete.
2005-03-01 22:35:21 +00:00
Alan Modra c9dea48b1f * as.h (assert): Warning fix.
* expr.c (expr): Correct assertion.
	* read.c (s_comm_internal): Remove assertion.
	* write.c (relax_segment): Enable vma assertion only for BFD_ASSEMBLER.
	(fixup_segment): Remove assertion.
	* config/tc-dlx.c (machine_ip): Remove untrue assertions.
	(md_apply_fix3): Likewise.
	* config/tc-i370.c (md_begin): Correct assertion.
	(i370_macro): Warning fix for assertion.
2005-03-01 02:00:15 +00:00
Mark Mitchell b2221023d3 * expr.c (operand): Handle the "~", "-", and "!" operators applied
to bignums.

	* gas/arm/bignum1.s: New test.
	* gas/arm/arm.exp: Run it.
2004-08-11 02:11:58 +00:00
Alan Modra 1181c20ef4 * expr.c (operand, operator): Don't reject '++' and '--'. 2004-05-23 04:35:11 +00:00
Alan Modra f4c724fc32 * expr.c (operand): Correct checks for ++ and --. 2004-04-16 01:55:27 +00:00
Nathan Sidwell 3e4caed2b1 * expr.c (operand): Reject ++ and --.
(operator): Likewise.
2004-03-18 09:19:20 +00:00
Kazu Hirata dd625418be * ehopt.c: Convert to ISO-C.
* emul.h: Likewise.
	* expr.c: Likewise.
	* expr.h: Likewise.
	* flonum-copy.c: Likewise.
	* flonum-mult.c: Likewise.
	* flonum.h: Likewise.
	* frags.c: Likewise.
	* frags.h: Likewise.
2003-11-22 16:03:03 +00:00
Richard Henderson 756d1d0188 * expr.c (make_expr_symbol): Fold FAKE_LABEL_NAME use into the
symbol_create call.
        (current_location): Use symbol_temp_new_now.
        * stabs.c (s_stab_generic): Use symbol_temp_new.
        * symbols.c (temp_label_name): Remove.
        (symbol_temp_new, symbol_temp_make): Use FAKE_LABEL_NAME.
2003-05-27 19:19:29 +00:00
Alan Modra 0200099915 * expr.c (operand): Add support for n.nn flonums. 2002-10-18 01:56:39 +00:00
Alan Modra f6cf69d700 * expr.c (expr): Simplify foo-foo here.
(clean_up_expression): Remove O_subtract code.
2002-09-20 00:58:39 +00:00
Alan Modra 263462410c * write.h (struct fix): Add fx_dot_value.
(dot_value): Declare.
	* write.c (dot_value): New var.
	(fix_new_internal): Save dot_value as fx_dot_value.
	* expr.c (expr): Update dot_value.
2002-09-19 23:51:35 +00:00
Alan Modra 7065849339 * dwarf2dbg.c: Always include dwarf2dbg.h.
(dwarf2_directive_file): Adjust dummy version args.
	* ecoff.c (ecoff_directive_weakext): Add ATTRIBUTE_UNUSED.
	* expr.c (clean_up_expression <O_subtract>): Allow subtraction
	when symbol values differ.
	* read.c (do_align): Add ATTRIBUTE_UNUSED to label.
	(pseudo_set <O_subtract>): Remove unnecessary segment test.
	* config/obj-bout.c (obj_pseudo_table): Warning fix.
2002-08-27 11:09:43 +00:00
Kazu Hirata 411863a44d * app.c: Fix formatting.
* as.c: Likewise.
	* ehopt.c: Likewise.
	* expr.c: Likewise.
	* input-file.c: Likewise.
	* listing.c: Likewise.
	* macro.h: Likewise.
	* stabs.c: Likewise.
	* symbols.c: Likewise.
2002-05-18 12:53:30 +00:00
Kazu Hirata 3b37fd6673 * app.c: Fix comment typos.
* bit_fix.h: Likewise.
	* expr.c: Likewise.
	* itbl-ops.c: Likewise.
2001-10-11 12:20:25 +00:00
H.J. Lu 3882b01078 Locale changes from Bruno Haible <haible@clisp.cons.org>. 2001-09-19 05:33:36 +00:00
Alan Modra e0890092b6 * expr.c (expr): Move code setting "retval" to the end of the loop,
and rearrange for efficiency.  For "PIC code" subtraction, use
	"rightseg" rather than recalculating.  For "symbol OP symbol"
	subtract, set "retval" to absolute_section if symbols in same
	section.
	* symbols.c (resolve_symbol_value): Resolve "sym +/- expr" to an
	O_symbol.  Simplify a +/- b code.  Allow equality and non-equality
	comparisons on symbols from any section.  Allow other comparison
	operators as for subtraction.
	(symbol_equated_reloc_p): New predicate function.
	* symbols.h (symbol_equated_reloc_p): Declare.
	* write.c (adjust_reloc_syms): Use symbol_equated_reloc_p.
	(write_relocs): Likewise.
	(write_object_file): Likewise.
	(relax_segment <rs_machine_dependent>): Ensure segment for
	expression syms is set correctly.
	* config/tc-mips.c (md_estimate_size_before_relax): Likewise.
	* config/tc-i386.c (md_assemble <Output jumps>): Don't lose part
	of a complex expression when setting up frag_var.
2001-09-09 14:01:17 +00:00
Jeff Johnston c68012fb32 2001-08-14 Jeff Johnston <jjohnstn@redhat.com>
* expr.c (operand)[LITERAL_PREFIXDOLLAR_HEX]: Treat $L as
        a label, not a hex constant.

This patch was approved by Nick Clifton.
2001-08-14 20:00:32 +00:00
Alan Modra 0e389e770d * read.c: Standardize error/warning messages - don't capitalise, no
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.
2001-08-01 01:44:25 +00:00
Nick Clifton 07a7a14553 Fix typo in comment 2001-06-13 11:29:53 +00:00
Alan Modra ce34c3732a Revert last patch. 2001-05-25 01:59:43 +00:00
Alan Modra 40e3ba9bb7 * expr.c (expr): Set return value to absolute_section for
subtractive operations on symbols within a segment.
	* read.c (pseudo_set): Set segment for complex expressions.
2001-05-25 00:01:30 +00:00
Alan Modra 6386f3a767 * symbols.c (resolve_symbol_value): Remove "finalize" param,
instead use finalize_syms directly.  Don't treat expressions
	specially with regard to finalize_syms.  Update calls to self.
	(resolve_local_symbol): Update call to resolve_symbol_value.
	(S_GET_VALUE): Likewise.  Return resolve_symbol_value if
	!finalize_syms.
	* symbols.h (resolve_symbol_value): Update prototype.
	* config/obj-aout.c (obj_crawl_symbol_chain): Update call
	to resolve_symbol_value.
	* config/obj-bout.c (obj_crawl_symbol_chain): Likewise.
	* config/obj-coff.c (do_relocs_for): Likewise.
	(yank_symbols): Likewise.
	(fixup_segment): Likewise.
	* config/obj-vms.c (obj_crawl_symbol_chain): Likewise.
	* config/tc-mips.c (md_convert_frag): Likewise.
	* config/tc-ppc.c (ppc_frob_symbol): Likewise.
	(ppc_fix_adjustable): Likewise.
	* dwarf2dbg.c (dwarf2dbg_estimate_size_before_relax): Likewise.
	(dwarf2dbg_convert_frag): Likewise.
	* ehopt.c (eh_frame_estimate_size_before_relax): Likewise.
	(eh_frame_convert_frag): Likewise.
	* expr.c (make_expr_symbol): Likewise.
	* write.c (adjust_reloc_syms): Likewise.
	(write_object_file): Likewise.
	(relax_segment): Likewise.
	(fixup_segment): Likewise.
	(finalize_syms): Init to zero, and update comment.
	(write_object_file): Set finalize_syms to 1 rather than 2.
	* doc/internals.texi (sy_value): Mention finalize_syms.
	(S_GET_VALUE): Remove restriction on when S_GET_VALUE can be called.
2001-05-22 10:23:50 +00:00
Alexandre Oliva a8a22e3365 * expr.c (operand): Pass &c to md_parse_name().
* config/tc-ia64.h, config/tc-ppc.h, config/tc-tic54x.h: Adjust.
2001-04-12 07:03:10 +00:00
Alan Modra 1a5447b835 Pass finalize_syms on calls to resolve_symbol_value. 2001-03-30 07:07:11 +00:00
Nick Clifton f7e42eb4af Fix copyright notices 2001-03-08 23:24:26 +00:00
Alan Modra c90cedf93e Update copyright date. 2001-02-13 11:17:48 +00:00
Alan Modra 6fad6acb13 Fix parsing of multi-char operators. 2001-02-13 11:13:53 +00:00
Alan Modra 1688794441 Correct {STANDARD,MRI}_MUL_PRECEDENCE value. 2000-11-28 13:33:22 +00:00
Kazu Hirata b041f888ac 2000-10-30 Kazu Hirata <kazu@hxi.com>
* expr.c: Fix formatting.
	* flonum-copy.c: Likewise.
	* flonum.h: Likewise.
	* gasp.c: Likewise.
	* hash.c: Likewise.
2000-10-30 21:59:01 +00:00
Kazu Hirata e6c774b42a 2000-10-17 Kazu Hirata <kazu@hxi.com>
* debug.c: Fix formatting.
	* depend.c: Likewise.
	* dwarf2dbg.c: Likewise.
	* dwarf2dbg.h: Likewise.
	* ecoff.c: Likewise.
	* expr.c: Likewise.
	* expr.h: Likewise.
	* flonum-konst.c: Likewise.
	* frags.h: Likewise.
2000-10-17 20:21:45 +00:00
Alan Modra 927781e250 Miscellaneous tiny fixes. 2000-09-05 03:53:02 +00:00
Nick Clifton 958b5f013a fix formatting 2000-09-03 21:51:27 +00:00
Kazu Hirata bc4466dcf1 2000-08-11 Kazu Hirata <kazu@hxi.com>
* expr.c: Fix formatting.
2000-08-11 17:50:25 +00:00
Kazu Hirata 929b12bc4e 2000-08-10 Kazu Hirata <kazu@hxi.com>
* expr.c: Fix formatting.
2000-08-10 23:13:37 +00:00
Frank Ch. Eigler 977e771a09 * new parsing option
2000-07-17  Frank Ch. Eigler  <fche@redhat.com>

	* expr.c (operand): Permit %bin literals if LITERAL_PREFIXPERCENT_BIN
	is defined.
2000-07-17 17:51:18 +00:00
Frank Ch. Eigler ed6d6fd3c4 * $literal support
2000-06-23  Frank Ch. Eigler  <fche@redhat.com>

	* expr.c (operand): Permit $hex literals if LITERAL_PREFIXDOLLAR_HEX
	is defined.
2000-06-23 10:51:28 +00:00