aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuinevere Larsen <guinevere@redhat.com>2024-11-25 13:14:57 -0300
committerGuinevere Larsen <guinevere@redhat.com>2024-12-03 15:12:28 -0300
commitab3cca26874c63c097873a75f86e7aeb4a49278e (patch)
tree8a8abb713fc8e485e64d697ae891c4fa21bde430
parentd556cf2ec79ed5afbbdd523484954c6a520b5b73 (diff)
downloadbinutils-ab3cca26874c63c097873a75f86e7aeb4a49278e.zip
binutils-ab3cca26874c63c097873a75f86e7aeb4a49278e.tar.gz
binutils-ab3cca26874c63c097873a75f86e7aeb4a49278e.tar.bz2
gdb/dbx: Remove stabsect_build_psymtab as it was unused
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>
-rw-r--r--gdb/dbxread.c84
-rw-r--r--gdb/stabsread.h3
2 files changed, 0 insertions, 87 deletions
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 1b29d6e..4cd7210 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -252,90 +252,6 @@ dbx_symfile_finish (struct objfile *objfile)
-/* 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);
-}
-
static const struct sym_fns aout_sym_fns =
{
dbx_new_init, /* init anything gbl to entire symtab */
diff --git a/gdb/stabsread.h b/gdb/stabsread.h
index 565038a..5f6f2df 100644
--- a/gdb/stabsread.h
+++ b/gdb/stabsread.h
@@ -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);