Make dwarf2_free_objfile static

I noticed that dwarf2_free_objfile can be made static, by changing it
to be a registry cleanup function.  This simplifies the code, as well,
because now symbol readers don't have to explicitly call it.

Tested by the buildbot.

gdb/ChangeLog
2018-06-28  Tom Tromey  <tom@tromey.com>

	* coffread.c (coff_symfile_finish): Update.
	* xcoffread.c (xcoff_symfile_finish): Update.
	* elfread.c (elf_symfile_finish): Update.
	* symfile.h (dwarf2_free_objfile): Don't declare.
	* dwarf2read.c (_initialize_dwarf2_read): Use
	register_objfile_data_with_cleanup.
	(dwarf2_free_objfile): Now static.  Change signature.
This commit is contained in:
Tom Tromey
2018-06-05 09:42:15 -06:00
parent 2512d7efdf
commit d95d3aef9e
6 changed files with 16 additions and 13 deletions

View File

@@ -1336,7 +1336,6 @@ elf_new_init (struct objfile *ignore)
static void
elf_symfile_finish (struct objfile *objfile)
{
dwarf2_free_objfile (objfile);
}
/* ELF specific initialization routine for reading symbols. */