]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove two fields from xcoff_symfile_info
authorTom Tromey <tom@tromey.com>
Thu, 8 Jan 2026 14:48:21 +0000 (07:48 -0700)
committerTom Tromey <tom@tromey.com>
Thu, 8 Jan 2026 17:43:41 +0000 (10:43 -0700)
Inspection shows that xcoff_symfile_info::min_lineno_offset and
xcoff_symfile_info::max_lineno_offset are never really used.  Removing
this then shows that find_linenos doesn't do any useful work.  So,
remove the fields and this function.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdb/xcoffread.c

index 5dc2da5395066d3f354bb3c82592000a6b8f62ba..ef78a4c9e594835fa5837a952b99c65ee80f31bb 100644 (file)
@@ -38,9 +38,6 @@
 \f
 struct xcoff_symfile_info
   {
-    file_ptr min_lineno_offset {};     /* Where in file lowest line#s are.  */
-    file_ptr max_lineno_offset {};     /* 1+last byte of line#s in file.  */
-
     /* Pointer to the string table.  */
     char *strtbl = nullptr;
 
@@ -131,36 +128,6 @@ xcoff_secnum_to_sections (int n_scnum, struct objfile *objfile,
     }
 }
 
-/* Support for line number handling.  */
-
-/* This function is called for every section; it finds the outer limits
- * of the line table (minimum and maximum file offset) so that the
- * mainline code can read the whole thing for efficiency.
- */
-static void
-find_linenos (struct bfd *abfd, struct bfd_section *asect, void *vpinfo)
-{
-  struct xcoff_symfile_info *info;
-  int size, count;
-  file_ptr offset, maxoff;
-
-  count = asect->lineno_count;
-
-  if (strcmp (asect->name, ".text") != 0 || count == 0)
-    return;
-
-  size = count * coff_data (abfd)->local_linesz;
-  info = (struct xcoff_symfile_info *) vpinfo;
-  offset = asect->line_filepos;
-  maxoff = offset + size;
-
-  if (offset < info->min_lineno_offset || info->min_lineno_offset == 0)
-    info->min_lineno_offset = offset;
-
-  if (maxoff > info->max_lineno_offset)
-    info->max_lineno_offset = maxoff;
-}
-
 /* Do initialization in preparation for reading symbols from OBJFILE.
 
    We will only be called if this is an XCOFF or XCOFF-like file.
@@ -363,11 +330,6 @@ xcoff_initial_scan (struct objfile *objfile, symfile_add_flags symfile_flags)
   num_symbols = bfd_get_symcount (abfd);       /* # of symbols */
   symtab_offset = obj_sym_filepos (abfd);      /* symbol table file offset */
 
-  info->min_lineno_offset = 0;
-  info->max_lineno_offset = 0;
-  for (asection *sec : gdb_bfd_sections (abfd))
-    find_linenos (abfd, sec, info);
-
   if (num_symbols > 0)
     {
       /* Read the .debug section, if present and if we're not ignoring