From: Tom Tromey Date: Thu, 8 Jan 2026 14:48:21 +0000 (-0700) Subject: Remove two fields from xcoff_symfile_info X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e5d318177d372278796cfbbb13a4d75966cffd1;p=thirdparty%2Fbinutils-gdb.git Remove two fields from xcoff_symfile_info 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 --- diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 5dc2da53950..ef78a4c9e59 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -38,9 +38,6 @@ 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