]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/dwarf: remove unnecessary abfd parameter in dwarf2_per_bfd::locate_sections
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 28 Feb 2025 19:27:12 +0000 (14:27 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 3 Mar 2025 20:58:29 +0000 (15:58 -0500)
The parameter `abfd` is always the same as `this->obfd`, there is no
need to pass it as a parameter.

Change-Id: If7ad58ad4efdf6b070cbf2b8a73436bd8b452fa6
Approved-By: Tom Tromey <tom@tromey.com>
gdb/dwarf2/read.c
gdb/dwarf2/read.h

index 1203cbd0ab62a5caed8a6ea9cdf9662e48371c1e..29af3dbf24ba4f2c3bb9ad9219833a1d68bd238e 100644 (file)
@@ -1261,7 +1261,7 @@ dwarf2_per_bfd::dwarf2_per_bfd (bfd *obfd, const dwarf2_debug_sections *names,
     names = &dwarf2_elf_names;
 
   for (asection *sec = obfd->sections; sec != NULL; sec = sec->next)
-    locate_sections (obfd, sec, *names);
+    this->locate_sections (sec, *names);
 }
 
 dwarf2_per_bfd::~dwarf2_per_bfd ()
@@ -1422,7 +1422,7 @@ dwarf2_has_info (struct objfile *objfile,
 /* See declaration.  */
 
 void
-dwarf2_per_bfd::locate_sections (bfd *abfd, asection *sectp,
+dwarf2_per_bfd::locate_sections (asection *sectp,
                                 const dwarf2_debug_sections &names)
 {
   flagword aflag = bfd_section_flags (sectp);
@@ -1430,13 +1430,13 @@ dwarf2_per_bfd::locate_sections (bfd *abfd, asection *sectp,
   if ((aflag & SEC_HAS_CONTENTS) == 0)
     {
     }
-  else if (bfd_section_size_insane (abfd, sectp))
+  else if (bfd_section_size_insane (this->obfd, sectp))
     {
       bfd_size_type size = sectp->size;
       warning (_("Discarding section %s which has an invalid size (%s) "
                 "[in module %s]"),
               bfd_section_name (sectp), phex_nz (size, sizeof (size)),
-              bfd_get_filename (abfd));
+              this->filename ());
     }
   else if (names.info.matches (sectp->name))
     {
index ccc8f4f8e8c4809fe584d397199c44f74fe3e19c..43d0e5d2ebf96880713f6fb6a068b7a83df0ace6 100644 (file)
@@ -517,8 +517,7 @@ private:
   /* This function is mapped across the sections and remembers the
      offset and size of each of the debugging sections we are
      interested in.  */
-  void locate_sections (bfd *abfd, asection *sectp,
-                       const dwarf2_debug_sections &names);
+  void locate_sections (asection *sectp, const dwarf2_debug_sections &names);
 
 public:
   /* The corresponding BFD.  */