Remove sym_fns::sym_new_init sym_fns::sym_new_init has long been weird. There's even a comment in symfile.c saying this. After some recent changes, nothing needs this any more. So, this patch removes it entirely. Approved-By: Simon Marchi <simon.marchi@efficios.com>
diff --git a/gdb/coffread.c b/gdb/coffread.c index 8284914..da45c41 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c
@@ -717,11 +717,6 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) } } -static void -coff_new_init (struct objfile *ignore) -{ -} - /* Perform any local cleanups required when we are done with a particular objfile. I.E, we are in the process of discarding all symbol information for an objfile, freeing up all memory held for @@ -2106,8 +2101,6 @@ coff_read_enum_type (int index, int length, int lastsym, static const struct sym_fns coff_sym_fns = { - coff_new_init, /* sym_new_init: init anything gbl to - entire symtab */ coff_symfile_init, /* sym_init: read initial info, setup for sym_read() */ coff_symfile_read, /* sym_read: read a symbol file into
diff --git a/gdb/elfread.c b/gdb/elfread.c index 2ad5e4e..7367007 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c
@@ -1279,15 +1279,6 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) objfile->object_format_has_copy_relocs = true; } -/* Initialize anything that needs initializing when a completely new symbol - file is specified (not just adding some symbols from another file, e.g. a - shared library). */ - -static void -elf_new_init (struct objfile *ignore) -{ -} - /* Perform any local cleanups required when we are done with a particular objfile. I.E, we are in the process of discarding all symbol information for an objfile, freeing up all memory held for it, and unlinking the @@ -1338,7 +1329,6 @@ static const struct sym_probe_fns elf_probe_fns = static const struct sym_fns elf_sym_fns = { - elf_new_init, /* init anything gbl to entire symtab */ elf_symfile_init, /* read initial info, setup for sym_read() */ elf_symfile_read, /* read a symbol file into symtab */ elf_symfile_finish, /* finished with file, cleanup */
diff --git a/gdb/machoread.c b/gdb/machoread.c index cbdf475..b645492 100644 --- a/gdb/machoread.c +++ b/gdb/machoread.c
@@ -73,11 +73,6 @@ struct oso_el }; static void -macho_new_init (struct objfile *objfile) -{ -} - -static void macho_symfile_init (struct objfile *objfile) { } @@ -929,7 +924,6 @@ macho_symfile_offsets (struct objfile *objfile, } static const struct sym_fns macho_sym_fns = { - macho_new_init, /* init anything gbl to entire symtab */ macho_symfile_init, /* read initial info, setup for sym_read() */ macho_symfile_read, /* read a symbol file into symtab */ macho_symfile_finish, /* finished with file, cleanup */
diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c index f48443c..2ede106 100644 --- a/gdb/symfile-debug.c +++ b/gdb/symfile-debug.c
@@ -709,18 +709,6 @@ static const struct sym_probe_fns debug_sym_probe_fns = /* Debugging version of struct sym_fns. */ static void -debug_sym_new_init (struct objfile *objfile) -{ - const struct debug_sym_fns_data *debug_data - = symfile_debug_objfile_data_key.get (objfile); - - gdb_printf (gdb_stdlog, "sf->sym_new_init (%s)\n", - objfile_debug_name (objfile)); - - debug_data->real_sf->sym_new_init (objfile); -} - -static void debug_sym_init (struct objfile *objfile) { const struct debug_sym_fns_data *debug_data @@ -833,7 +821,6 @@ install_symfile_debug_logging (struct objfile *objfile) (to)->debug_sf.name = func; \ } while (0) - COPY_SF_PTR (real_sf, debug_data, sym_new_init, debug_sym_new_init); COPY_SF_PTR (real_sf, debug_data, sym_init, debug_sym_init); COPY_SF_PTR (real_sf, debug_data, sym_read, debug_sym_read); COPY_SF_PTR (real_sf, debug_data, sym_finish, debug_sym_finish);
diff --git a/gdb/symfile.c b/gdb/symfile.c index 2b42138..01467a9 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c
@@ -935,8 +935,6 @@ syms_from_objfile_1 (struct objfile *objfile, If the user wants to get rid of them, they should do "symbol-file" without arguments first. Not sure this is the best behavior (PR 2207). */ - - (*objfile->sf->sym_new_init) (objfile); } /* Convert addr into an offset rather than an absolute address. @@ -2618,14 +2616,6 @@ reread_symbols (int from_tty) build_objfile_section_table (&objfile); - /* What the hell is sym_new_init for, anyway? The concept of - distinguishing between the main file and additional files - in this way seems rather dubious. */ - if (&objfile == current_program_space->symfile_object_file) - { - (*objfile.sf->sym_new_init) (&objfile); - } - (*objfile.sf->sym_init) (&objfile); clear_complaints ();
diff --git a/gdb/symfile.h b/gdb/symfile.h index 9ca17c3..8d9399a 100644 --- a/gdb/symfile.h +++ b/gdb/symfile.h
@@ -117,12 +117,6 @@ struct sym_probe_fns struct sym_fns { - /* Initializes anything that is global to the entire symbol table. - It is called during symbol_file_add, when we begin debugging an - entirely new program. */ - - void (*sym_new_init) (struct objfile *); - /* Reads any initial information from a symbol file, and initializes the struct sym_fns SF in preparation for sym_read(). It is called every time we read a symbol file for any reason. */
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 74ce92b..a9ea574 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c
@@ -100,8 +100,6 @@ static void scan_xcoff_symtab (struct objfile *); static void xcoff_symfile_init (struct objfile *); -static void xcoff_new_init (struct objfile *); - static void xcoff_symfile_finish (struct objfile *); /* Search all BFD sections for the section whose target_index is @@ -171,11 +169,6 @@ find_linenos (struct bfd *abfd, struct bfd_section *asect, void *vpinfo) info->max_lineno_offset = maxoff; } -static void -xcoff_new_init (struct objfile *objfile) -{ -} - /* Do initialization in preparation for reading symbols from OBJFILE. We will only be called if this is an XCOFF or XCOFF-like file. @@ -499,7 +492,6 @@ static const struct sym_fns xcoff_sym_fns = xcoffread.c reads all the symbols and does in fact randomly access them (in C_BSTAT and line number processing). */ - xcoff_new_init, /* init anything gbl to entire symtab */ xcoff_symfile_init, /* read initial info, setup for sym_read() */ xcoff_initial_scan, /* read a symbol file into symtab */ xcoff_symfile_finish, /* finished with file, cleanup */