* frags.c (frags): Variable deleted.
(frag_alloc): New function.
(frag_grow, frag_more, frag_variant, frag_now_fix, frag_append_1_char): Refer
to frchain_now->frch_obstack instead of frags variable.
(frag_new): Ditto. Verify that frch_last and frag_now match on entry and exit,
and that old frag_now has non-zero type. Replace "know" uses with "assert".
Use frag_alloc instead of mucking with obstack alignment.
* frags.h (frags): Declaration deleted.
* subsegs.h (struct frchain): Add new field frch_frag_now.
* subsegs.c (frchains, dummy_frag, absolute_frchain): New static variables.
(subsegs_begin): Initialize frchains obstack. Under gcc, don't give it any
stricter alignment than frchainS structures need. Do not initialize frags
obstack. Set frag_now to point to dummy_obstack. Initialize absolute_frchain.
(subseg_set_rest): Save and restore frag_now in frch_frag_now field of
frchainS. Don't create new frags on section switch, and use frag_alloc when
creating a new frag chain. For absolute section, set frchain_now to
absolute_frchain. Verify that frch_last and frag_now match on entry and exit.
Initialize per-chain obstack, and under gcc, set required alignment to that
needed by fragS structure.
* write.c (chain_frchains_together_1): Verify fr_type is nonzero.
In one test case of Mike's (i386-linux, over 300K lines of .s code with lots
of stabs records), run time and memory use are reduced by about 1/3.
Might introduce some problems in cases that use the frag obstacks in unusual
ways. Test suite does pass for i386-linux and sparc-solaris targets though.
* read.h (mri_comon_symbol): Declare.
(s_mri_common): Declare.
* read.c (mri_line_label): New static variable.
(mri_common_symbol): New global variable.
(potable): Add "common" and "common.s".
(read_a_source_file): In MRI mode, set mri_line_label for a label
at the start of a line.
(s_mri_common): New function.
(s_space): Handle mri_common_symbol.
* symbols.c (colon): Change return value from void to symbolS *,
and return new symbol. If mri_common_symbol is set, attach the
new symbol to it.
(resolve_symbol_value): Handle an sy_mri_common symbol.
* symbols.h (colon): Change return value in declaration.
* subsegs.c (subseg_set_rest): Clear mri_common_symbol.
(subseg_set (both versions)): Likewise.
* frags.c (frag_more): Warn if mri_common_symbol is not NULL.
* write.c (adjust_reloc_syms): Skip sy_mri_common symbols.
(write_object_file): Discard sy_mri_common symbols.
(fixup_segment): Change relocations against sy_mri_common symbols
to be against the common symbol itself.
* config/obj-coff.c (yank_symbols): Discard sy_mri_common symbols.
(fixup_segment): Change relocations against sy_mri_common symbols
to be against the common symbol itself.
* config/obj-aout.c (obj_crawl_symbol_chain): Discard
sy_mri_common symbols.
* symbols.c (symbol_create): New function, most of the guts of the old
symbol_new function.
(symbol_new): Now just checks symbol_table_frozen, calls symbol_create, and
enters the symbol into the symbol table.
* subsegs.c (section_symbol): If EMIT_SECTION_SYMBOLS is not true, and the
symbol table is frozen, call symbol_create instead of symbol_new.
* symbols.h (symbol_create, symbol_table_frozen): Declare.
* symbols.c (symbol_clear_list_pointers): Always a function now.
* struc-symbol.h (symbol_clear_list_pointers): Deleted macro version.
* symbols.c (debug_verify_symchain): New macro, defined to be
verify_symbol_chain or a cast to void, depending on DEBUG_SYMS.
(many functions): Invoke debug_verify_symchain unconditionally.
(subseg_change): Store seg_info for bfd_abs_section_ptr in
abs_seg_info, and store seg_info for bfd_und_section_ptr in
und_seg_info.
(subseg_get): Likewise. Also, don't set output_section if it is
already set.
(seg_info): Define as function.
* subsegs.h (seg_info): Declare as function rather than defining
as macro.
* write.c (relax_and_size_seg): Call seg_info rather than
bfd_get_section_userdata.
* subsegs.c (subsegs_begin): Call memset with args in the correct
order.
(subseg_get): Clear newly allocated seginfo, set its pointer slots
to NULL instead of 0.
Fixes a problem observed in sparc-lynx progressive.
set then a new segment is always created. All callers changed.
(subseg_force_new): New function. Similar to subseg_new, but
always force a new segment to be created.
Wrote non-BFD_ASSEMBLER subseg_new. Now subseg_new always takes a
section name, and subseg_set always takes a segT. Changed all
callers as appropriate.
* config/obj-coffbfd.c (change_to_section): Renamed to
obj_coff_add_segment. Corrected. Made callers use subseg_new.
* config/obj-coffbfd.h (obj_segment_name, obj_add_segment):
Define.
Also some more gcc warning removal.
as data0_frchainP
* write.c (write_object_file): various changes to handle data in
the BSS segment in much the same was as stuff in the DATA segment.
* subsegs.c (subseg_change): allow and handle a change into SEG_BSS.
* 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.