[binutils-gdb] Remove sym_fns::sym_read_linetable
Tom Tromey
tromey@sourceware.org
Thu Jan 8 13:42:32 GMT 2026
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=cc752a15b2a62d506550ed6f890cf21158a9cf4c
commit cc752a15b2a62d506550ed6f890cf21158a9cf4c
Author: Tom Tromey <tom@tromey.com>
Date: Wed Jan 7 09:49:13 2026 -0700
Remove sym_fns::sym_read_linetable
The last user of sym_fns::sym_read_linetable was xcoffread.c. Now
that the code there has been removed, this callback can be removed as
well. This slightly simplifies buildsym.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diff:
---
gdb/buildsym.c | 5 -----
gdb/coffread.c | 1 -
gdb/elfread.c | 1 -
gdb/machoread.c | 1 -
gdb/symfile-debug.c | 14 --------------
gdb/symfile.h | 6 ------
gdb/xcoffread.c | 7 -------
7 files changed, 35 deletions(-)
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 0e1b6292bf9..739343f46c7 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -799,11 +799,6 @@ buildsym_compunit::end_compunit_symtab_from_static_block
true, expandable);
blockvector_up blockvector = make_blockvector ();
- /* Read the line table if it has to be read separately.
- This is only used by xcoffread.c. */
- if (m_objfile->sf->sym_read_linetable != NULL)
- m_objfile->sf->sym_read_linetable (m_objfile);
-
/* Handle the case where the debug info specifies a different path
for the main source file. It can cause us to lose track of its
line number information. */
diff --git a/gdb/coffread.c b/gdb/coffread.c
index a94da096e15..54dcc7c765f 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -2099,7 +2099,6 @@ static const struct sym_fns coff_sym_fns =
internal form */
default_symfile_segments, /* sym_segments: Get segment
information from a file */
- NULL, /* sym_read_linetable */
default_symfile_relocate, /* sym_relocate: Relocate a debug
section. */
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 062a4845bb4..60785ace56d 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -1323,7 +1323,6 @@ static const struct sym_fns elf_sym_fns =
elf_symfile_read, /* read a symbol file into symtab */
default_symfile_offsets, /* Translate ext. to int. relocation */
elf_symfile_segments, /* Get segment information from a file. */
- NULL,
default_symfile_relocate, /* Relocate a debug section. */
&elf_probe_fns, /* sym_probe_fns */
};
diff --git a/gdb/machoread.c b/gdb/machoread.c
index aa76ee779c5..334e3b41b6a 100644
--- a/gdb/machoread.c
+++ b/gdb/machoread.c
@@ -923,7 +923,6 @@ static const struct sym_fns macho_sym_fns = {
macho_symfile_read, /* read a symbol file into symtab */
macho_symfile_offsets, /* xlate external to internal form */
default_symfile_segments, /* Get segment information from a file. */
- NULL,
macho_symfile_relocate, /* Relocate a debug section. */
NULL, /* sym_get_probes */
};
diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c
index 5e4e6224ddb..6562dcad433 100644
--- a/gdb/symfile-debug.c
+++ b/gdb/symfile-debug.c
@@ -755,18 +755,6 @@ debug_sym_segments (bfd *abfd)
gdb_assert_not_reached ("debug_sym_segments called");
}
-static void
-debug_sym_read_linetable (struct objfile *objfile)
-{
- const struct debug_sym_fns_data *debug_data
- = symfile_debug_objfile_data_key.get (objfile);
-
- gdb_printf (gdb_stdlog, "sf->sym_read_linetable (%s)\n",
- objfile_debug_name (objfile));
-
- debug_data->real_sf->sym_read_linetable (objfile);
-}
-
static bfd_byte *
debug_sym_relocate (struct objfile *objfile, asection *sectp, bfd_byte *buf)
{
@@ -813,8 +801,6 @@ install_symfile_debug_logging (struct objfile *objfile)
COPY_SF_PTR (real_sf, debug_data, sym_read, debug_sym_read);
COPY_SF_PTR (real_sf, debug_data, sym_offsets, debug_sym_offsets);
COPY_SF_PTR (real_sf, debug_data, sym_segments, debug_sym_segments);
- COPY_SF_PTR (real_sf, debug_data, sym_read_linetable,
- debug_sym_read_linetable);
COPY_SF_PTR (real_sf, debug_data, sym_relocate, debug_sym_relocate);
if (real_sf->sym_probe_fns)
debug_data->debug_sf.sym_probe_fns = &debug_sym_probe_fns;
diff --git a/gdb/symfile.h b/gdb/symfile.h
index 336fe93d582..f191db0c239 100644
--- a/gdb/symfile.h
+++ b/gdb/symfile.h
@@ -144,12 +144,6 @@ struct sym_fns
symfile_segment_data_up (*sym_segments) (bfd *abfd);
- /* This function should read the linetable from the objfile when
- the line table cannot be read while processing the debugging
- information. */
-
- void (*sym_read_linetable) (struct objfile *);
-
/* Relocate the contents of a debug section SECTP. The
contents are stored in BUF if it is non-NULL, or returned in a
malloc'd buffer otherwise. */
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 5a9a39042b8..5dc2da53950 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -131,12 +131,6 @@ xcoff_secnum_to_sections (int n_scnum, struct objfile *objfile,
}
}
-static void
-aix_process_linenos (struct objfile *objfile)
-{
-}
-
-
/* Support for line number handling. */
/* This function is called for every section; it finds the outer limits
@@ -484,7 +478,6 @@ static const struct sym_fns xcoff_sym_fns =
xcoff_initial_scan, /* read a symbol file into symtab */
xcoff_symfile_offsets, /* xlate offsets ext->int form */
default_symfile_segments, /* Get segment information from a file. */
- aix_process_linenos,
default_symfile_relocate, /* Relocate a debug section. */
NULL, /* sym_probe_fns */
};
More information about the Gdb-cvs
mailing list