Use one active frag and one obstack per frag chain:
* 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.