]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/dbx: Remove stabsect_build_psymtab as it was unused
authorGuinevere Larsen <guinevere@redhat.com>
Mon, 25 Nov 2024 16:14:57 +0000 (13:14 -0300)
committerGuinevere Larsen <guinevere@redhat.com>
Tue, 3 Dec 2024 18:12:28 +0000 (15:12 -0300)
The function stabsect_build_psymtabs, defined in the dbxread file, is no
longer used in any parts of GDB, so this commit just removes it.

Tested by rebuilding.

Approved-By: Andrew Burgess <aburgess@redhat.com>
gdb/dbxread.c
gdb/stabsread.h

index 1b29d6e7c55233e5fd2a423be71e12b71cfe4724..4cd721057bc7ad3069ed47ef950791300be7cd77 100644 (file)
@@ -252,90 +252,6 @@ dbx_symfile_finish (struct objfile *objfile)
 \f
 \f
 \f
-/* Scan and build partial symbols for a file with special sections for stabs
-   and stabstrings.  The file has already been processed to get its minimal
-   symbols, and any other symbols that might be necessary to resolve GSYMs.
-
-   This routine is the equivalent of dbx_symfile_init and dbx_symfile_read
-   rolled into one.
-
-   OBJFILE is the object file we are reading symbols from.
-   ADDR is the address relative to which the symbols are (e.g. the base address
-   of the text segment).
-   STAB_NAME is the name of the section that contains the stabs.
-   STABSTR_NAME is the name of the section that contains the stab strings.
-
-   This routine is mostly copied from dbx_symfile_init and
-   dbx_symfile_read.  */
-
-void
-stabsect_build_psymtabs (struct objfile *objfile, char *stab_name,
-                        char *stabstr_name, char *text_name)
-{
-  int val;
-  bfd *sym_bfd = objfile->obfd.get ();
-  const char *name = bfd_get_filename (sym_bfd);
-  asection *stabsect;
-  asection *stabstrsect;
-  asection *text_sect;
-
-  stabsect = bfd_get_section_by_name (sym_bfd, stab_name);
-  stabstrsect = bfd_get_section_by_name (sym_bfd, stabstr_name);
-
-  if (!stabsect)
-    return;
-
-  if (!stabstrsect)
-    error (_("stabsect_build_psymtabs:  Found stabs (%s), "
-            "but not string section (%s)"),
-          stab_name, stabstr_name);
-
-  dbx_objfile_data_key.emplace (objfile);
-
-  text_sect = bfd_get_section_by_name (sym_bfd, text_name);
-  if (!text_sect)
-    error (_("Can't find %s section in symbol file"), text_name);
-  DBX_TEXT_ADDR (objfile) = bfd_section_vma (text_sect);
-  DBX_TEXT_SIZE (objfile) = bfd_section_size (text_sect);
-
-  DBX_SYMBOL_SIZE (objfile) = sizeof (struct external_nlist);
-  DBX_SYMCOUNT (objfile) = bfd_section_size (stabsect)
-    / DBX_SYMBOL_SIZE (objfile);
-  DBX_STRINGTAB_SIZE (objfile) = bfd_section_size (stabstrsect);
-  DBX_SYMTAB_OFFSET (objfile) = stabsect->filepos;     /* XXX - FIXME: POKING
-                                                          INSIDE BFD DATA
-                                                          STRUCTURES */
-
-  if (DBX_STRINGTAB_SIZE (objfile) > bfd_get_size (sym_bfd))
-    error (_("ridiculous string table size: %d bytes"),
-          DBX_STRINGTAB_SIZE (objfile));
-  DBX_STRINGTAB (objfile) = (char *)
-    obstack_alloc (&objfile->objfile_obstack,
-                  DBX_STRINGTAB_SIZE (objfile) + 1);
-  OBJSTAT (objfile, sz_strtab += DBX_STRINGTAB_SIZE (objfile) + 1);
-
-  /* Now read in the string table in one big gulp.  */
-
-  val = bfd_get_section_contents (sym_bfd,     /* bfd */
-                                 stabstrsect,  /* bfd section */
-                                 DBX_STRINGTAB (objfile), /* input buffer */
-                                 0,            /* offset into section */
-                                 DBX_STRINGTAB_SIZE (objfile)); /* amount to
-                                                                   read */
-
-  if (!val)
-    perror_with_name (name);
-
-  stabsread_new_init ();
-  free_header_files ();
-  init_header_files ();
-
-  /* Now, do an incremental load.  */
-
-  dbx_objfile_data_key.get (objfile)->ctx.processing_acc_compilation = 1;
-  dbx_symfile_read (objfile, 0);
-}
-\f
 static const struct sym_fns aout_sym_fns =
 {
   dbx_new_init,                        /* init anything gbl to entire symtab */
index 565038ae4acafbad42b05931ad97bd3c87f5a7f6..5f6f2df87b52fa0ed23382920665f87d0b24f88a 100644 (file)
@@ -202,9 +202,6 @@ extern void coffstab_build_psymtabs
    const std::vector<asection *> &stabs,
    file_ptr stabstroffset, unsigned int stabstrsize);
 
-extern void stabsect_build_psymtabs (struct objfile *objfile, char *stab_name,
-                                    char *stabstr_name, char *text_name);
-
 extern int symbol_reference_defined (const char **);
 
 extern void ref_add (int, struct symbol *, const char *, CORE_ADDR);