alloc gas seginfo on notes obstack
authorAlan Modra <amodra@gmail.com>
Mon, 4 Jul 2022 03:15:47 +0000 (12:45 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 4 Jul 2022 13:21:56 +0000 (22:51 +0930)
commiteeeaf705fe1c94e9330fa222d7928a9d0f03832a
treeedbba8cbb9a0deedb2dda7a037511c9ef2031d1b
parent0772daccb3ebaf513badf4266e1948454b4455c1
alloc gas seginfo on notes obstack

Lots of memory used in gas should go on this obstack.  The patch also
frees all the gas obstacks on exit, which isn't a completely trivial
task.

* subsegs.c (alloc_seginfo): New function.
(subseg_change, subseg_get): Use it.
(subsegs_end): New function.
* as.h (subsegs_end): Declare.
* output-file.c: Include subsegs.h
(stash_frchain_obs): New function.
(output_file_close): Save obstacks attached to output bfd before
closing.  Call subsegs_end with the array of obstacks.
gas/as.h
gas/output-file.c
gas/subsegs.c