* expr.c (expr): Account for new operatorT values in know
expression.
* write.c (fixup_segment): Clear fixp->fx_subsy if the relocation
is fully resolved.
* macro.c (ISSEP): Remove duplicated `"' character.
(get_any_string): Copy some characters for which ISSEP is true:
';', '>', '(', ')'. Otherwise we can get in an infinite loop.
* read.c (s_space): In MRI mode, the expressions stop at the first
unquoted space.
(cons_worker): In MRI mode, restore the terminating character at
the end of the function.
* as.h (flag_mri): Declare/define.
* as.c (show_usage): Mention -M and its synonym --mri.
(parse_args): Add 'M' to std_shortopts. Add "mri" to
std_longopts. Set flag_mri if -M is seen.
(main): Call parse_args before input_scrub_begin. Call
expr_begin.
* app.c (do_scrub_begin): Don't set lex for '"' or '\'' in MRI
mode. Do set lex for ';', '*', and '!' in MRI mode.
(do_scrub_next_char): Remove MRI ifdef in LEX_IS_WHITESPACE case.
In MRI mode, keep spaces between labels and colons. Remove MRI
ifndef around LEX_IS_ONECHAR_QUOTE case. In MRI mode, don't use
'!' or '*' as comment characters even if they are in
comment_chars.
* read.h (lex_type): No longer const.
* read.c: Include libiberty.h.
(lex_type): No longer const.
(read_begin): In MRI mode, set lex_type of '?' to 3.
(potable): Add dc, dc.b, dc.d, dc.l, dc.s, dc.w, dc.x, ds, ds.b,
ds.l, ds.w, and xdef.
(read_a_source_file): Change LABELS_WITHOUT_COLON ifdef to check
for MRI mode at runtime rather than compile time. Handle the EQU
pseudo-op in MRI mode. Remove bogus MRI ifdef around done_pseudo.
Change NO_PSEUDO_DOT ifdef to also take effect for MRI mode at
runtime.
(cons): In MRI mode, always call parse_mri_cons rather than
TC_PARSE_CONS_EXPRESSION.
(parse_mri_cons): Always compile, not just when MRI is defined.
Call TC_PARSE_CONS_EXPRESSION, not expression, when the input is
not a string constant. Handle A and E modifiers.
(float_cons): Accept :xxxx, where the x's are hex digits.
* expr.h (operatorT): Add O_eq, O_ne, O_lt, O_le, O_ge, O_gt.
(expr_begin): Declare.
* expr.c (integer_constant): In MRI mode, if the base was not
specified, look for a suffix on the number to set the base.
(mri_char_constant): New static function.
(operand): Remove MRI ifdef. In MRI mode, do various things: Pass
0 as the base when calling integer_constant if there was no
prefix. Check for a hex constant suffix if when a leading '0' is
seen. Don't accept 0x or 0b as a prefix. Check for E'chars' and
A'chars'. Handle MRI character constants. Treat '"' as the
unary bitwise not operator. Treat $ as the program counter, or as
the prefix for a hex constant. Treat % as the prefix for a binary
constant and @ as the prefix for an octal constant. Treat : as
the prefix for a hex constant.
(op_encoding): Set '"' to O_bit_not, '<' to O_lt, and '>' to O_gt.
(op_rank): No longer const. Change rank values.
(expr_begin): New function.
(operator): New static function.
(expr): Use operator. Don't bother to mention the operator in
warnings. Remove bogus #if 0 code. Handle new operatorT values.
* atof-generic.c (atof_generic): In MRI mode, accept underscores
around the exponent in floating point numbers.
* symbols.h (symbols_case_sensitive): Declare.
* symbols.c (symbols_case_sensitive): New global variable.
(symbol_create): Check symbols_case_sensitive.
(symbol_find_base): Likewise.
(resolve_symbol_value): Handle new operatorT values.
(print_expr_1): Likewise.
(S_IS_LOCAL): In MRI mode, names beginning with two '?' characters
are local.
just return the symbol. If operator is O_constant, resolve the symbol's value
before returning.
(operand): Permit use of "[]" for grouping.
(clean_up_expression): For difference of two symbols in the same frag, add the
difference of their offsets into X_add_number.
(expr): Reduce difference of two symbols in same frag to their difference.
* expr.c (operand): Set sy_used for any symbol used as an operand.
(expr): Likewise for any symbol used in an expression.
* config/tc-hppa.h (tc_frob_symbol): Define. Punt imported
symbols which are never used and absolute symbols which local scope.
undefined symbols.
Fixes PR 2997.
* read.c (s_data), config/obj-coffbfd.c (obj_coff_data): If -R,
switch to text section rather than data section.
Fixes PR 2971.
expr.c (__): Undefine before defining.
as.c (got_sig): Don't return anything; return type might be void.
Whitespace/comment cleanup in frags.c.
Some patches for `-pedantic' or `-fno-common' compilation.
(Some of these changes are from Michael Meissner; see change log.)
* app.c, config/tc-*.c: Don't include read.h, since it is already
included by as.h.
* These are based on patches from Minh Tran-le
<mtranle@paris.intellicorp.com>.
* configure.in (i[34]86-ibm-aix*): Accept i486 for host. Use
obj_format coffbfd and gas_target i386coff for target.
(i[34]86-*-isc*): New host (uses sysv).
* config/i386aix.mt: Removed (no longer used).
* config/mh-i386aix (RANLIB): Use true rather than /bin/true.
(MINUS_G): Removed.
(LDFLAGS): Added, defined as -shlib.
* config/te-i386aix.h (REVERSE_SORT_RELOCS): Undefine.
* config/te-sco386.h (LOCAL_LABEL): Don't define.
(DOT_LABEL_PREFIX): Define.
* expr.c (operand): If DOT_LABEL_PREFIX, use .L0\001 as a label
name rather than L0\001.
* read.c (s_lcomm): Make a frag in SEG_BSS rather than using
local_bss_counter.
* symbols.c, symbols.h (local_bss_counter): Removed.
* write.c (write_object_file): bss no longer uses
local_bss_counter. Pass correct data and bss size to
VMS_write_object_file.
* config/obj-vms.c (VMS_write_object_file): Accept bss size as
argument, rather than using local_bss_counter.
* config/tc-m88k.c (s_bss): Don't use local_bss_counter.
* config/tc-sparc.c (s_reserve): Don't use local_bss_counter.
* config/obj-coffbfd.c (had_lineno, had_reloc): Removed.
(size_section): Restored sanity check.
(do_relocs_for): Base section address on s_paddr rather than
computing it. Adjust a29k R_IHIHALF special case to account for
section paddr (used to require paddr to be zero). If there are no
reclos, set s_relptr to 0. Set relocation size in object_headers.
(fill_section): Always set s_vaddr here, removing
ZERO_BASED_SEGMENTS case. Force s_scnptr for bss to 0. Don't set
NOLOAD for i386 .bss, because it confuses the SVR3 native linker.
Set STYP_INFO for .comment.
(coff_header_append): Use object headers and H_{SET,GET}_* macros.
Make aouthdr writing depend on OBJ_COFF_OMIT_OPTIONAL_HEADER.
(crawl_symbols): Handle 8 character section name correctly. Use
H_{SET,GET}_* macros.
(do_linenos_for): Set lineno size in object_headers.
(write_object_file): Use H_{SET,GET}_* macros. Don't bother to
set s_vaddr here. If string_byte_count remains 4, set it back to
0, and only write strings out if there are some. Call
fill_section before do_relocs_for and do_linenos_for.
(obj_coff_section): Handle optional quoted second argument giving
section characteristics.
(obj_coff_bss): Added to handle .bss.
(obj_coff_ident): Added to handle .ident (puts string in .comment
section).
(obj_coff_lcomm): Put common symbols in .bss, not .data.
(fixup_mdeps): Change to segment. Call frag_wane after
md_convert_frag.
(fixup_segment): Explicitly check S_IS_COMMON before making 386
adjustment (already happened only for common symbols, but this is
clearer).
* config/obj-coffbfd.h (OBJ_COFF_OMIT_OPTIONAL_HEADER): Define.
* config/tc-i386.c (s_bss): Don't use if I386COFF.
(md_pseudo_table): Ignore .optim and .noopt.
(tc_coff_sizemachdep): New function.
* config/tc-i386.h (REVERSE_SORT_RELOCS): Undef, for SVR3
compatibility.
(LOCAL_LABEL): Removed definition.
(DOT_LABEL_PREFIX): Defined.
* expr.c(expr): allow SEG_REGISTER in expressions.
* read.c(pseudo_set): register expressions can be the source of a
set.
* subsegs.c (subseg_new): Now -R forces all changes to SEG_DATA to
goto SEG_TEXT (if a.out)
* write.c (write_object_file): If a.out don't use the old way for
-R.
* config/obj-a.out (s_sect): complain if the user tries to use a
subsegment with a value which might interfere with out -R hackery.
* config/tc-m68k.c (m68k_reg_parse): lookup names in symbol table
rather than use ugly if tree. (init_regtable): insert register
names into symbol table.
* expr.c: LOCAL_LABELS_FB had been changed to lower case - so
local labels didn't work.
* listing.c (list_symbol_table): don't core dump when there's no
symbol there.
* write.c, write.h: call fix_new with the right number of args on
the H8.
* config/tc-h8300.[ch] : fix bugs reported by HMSI, and make
errors nicer
* as.c: fix typo recently introduced.
* as.h : Don't include aout/reloc.h - it's not right for COFF!
* expr.c: Much rewriting, to accomodate MRI syntax for
expressions. Also easier to read now.
* listing.c: Put back defuns
* read.c: modified to accept MRI syntax, put back listing pseudo
ops so that an assembler built with NO_LISTING ignores list ops
rather than pukes.
* write.c, write.h: fixs - only keep a reloc type in a fix if the target
machine is a SPARC or a 29K.
* config/obj-aout.c: added s_sect pseudo op
* config/obj-coffbfd.c: lints, set the filehdr flags right and
fill in the timestamp.
* config/obj-coffbfd.h: Since we don't include aout/reloc.h
anymore, define all the relocs which the tc-<x> bit will use so we
can translate from them to the coff types.
* config/tc-a29k.c: reloc_type isn't ane enum any more
* config/tc-m68k.c: Added NO_RELOC definition.
Now compiles for sparc aout, 68k aout (MRI and MIT syntax),
29k coff.
So far works as replacement for sparc and 68k /bin/as.