gas obj_end

Provide a way for config/obj-* to clean up at end of assembly, and do
so for ELF.

	* obj.h (struct format_ops): Add "end".
	* config/obj-aout.c (aout_format_ops): Init new field.
	* config/obj-coff.c (coff_format_ops): Likewise.
	* config/obj-ecoff.c (ecoff_format_ops): Likewise.
	* config/obj-elf.c (elf_format_ops): Likewise.
	(elf_begin): Move later in file.  Clear some more variables.
	(comment_section): Make file scope.
	(free_section_idx): Rewrite.
	(elf_adjust_symtab): Expand str_htab_create call and use
	free_section_idx as delete function.
	(elf_frob_file_after_relocs): Don't clean up groups.indexes here.
	(elf_end): New function.
	* config/obj-elf.h (obj_end): Define.
	* config/obj-multi.h (obj_end): Define.
	* output-file.c (output_file_close): Call obj_end.
This commit is contained in:
Alan Modra
2023-02-01 23:11:30 +10:30
parent 43e5fbd8b7
commit 2ccd2276a4
8 changed files with 69 additions and 28 deletions

View File

@@ -290,6 +290,7 @@ const struct format_ops ecoff_format_ops =
the single-format definition (0) would be in order. */
1, /* emit_section_symbols. */
0, /* begin. */
0, /* end. */
ecoff_new_file,
obj_ecoff_frob_symbol,
ecoff_frob_file,