]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
bfd/COFF: mark a function exposed to ld as non-private
authorJan Beulich <jbeulich@suse.com>
Fri, 21 Nov 2025 08:05:36 +0000 (09:05 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 21 Nov 2025 08:05:36 +0000 (09:05 +0100)
As a non-private function, _bfd_coff_read_internal_relocs() shouldn't have
a "_bfd_" prefix, but merely a "bfd_" one. Tidy arguments passed whle at
it.

bfd/coff-arm.c
bfd/coff-sh.c
bfd/coffgen.c
bfd/cofflink.c
bfd/libcoff-in.h
bfd/libcoff.h
bfd/xcofflink.c
ld/pdb.c

index 94faaf640bbd457220ec92b9f434f61b70c9f6ca..babb1b23a63b0de3e041d1934927949a5935396c 100644 (file)
@@ -2060,7 +2060,7 @@ bfd_arm_process_before_allocation (bfd *             abfd,
 
       /* Load the relocs.  */
       /* FIXME: there may be a storage leak here.  */
-      i = _bfd_coff_read_internal_relocs (abfd, sec, 1, 0, 0, 0);
+      i = bfd_coff_read_internal_relocs (abfd, sec, true, NULL, false, NULL);
 
       BFD_ASSERT (i != 0);
 
index 928d13a4d18ac90dced0a61d2815d7c2ae433f98..a727432d5ceddc964145b904e66a8fb1c98500c9 100644 (file)
@@ -731,10 +731,9 @@ sh_relax_section (bfd *abfd,
        return false;
     }
 
-  internal_relocs = (_bfd_coff_read_internal_relocs
+  internal_relocs = (bfd_coff_read_internal_relocs
                     (abfd, sec, link_info->keep_memory,
-                     (bfd_byte *) NULL, false,
-                     (struct internal_reloc *) NULL));
+                     NULL, false, NULL));
   if (internal_relocs == NULL)
     goto error_return;
 
@@ -1374,9 +1373,8 @@ sh_relax_delete_bytes (bfd *abfd,
       /* We always cache the relocs.  Perhaps, if info->keep_memory is
         FALSE, we should free them, if we are permitted to, when we
         leave sh_coff_relax_section.  */
-      internal_relocs = (_bfd_coff_read_internal_relocs
-                        (abfd, o, true, (bfd_byte *) NULL, false,
-                         (struct internal_reloc *) NULL));
+      internal_relocs = (bfd_coff_read_internal_relocs
+                        (abfd, o, true, NULL, false, NULL));
       if (internal_relocs == NULL)
        return false;
 
@@ -2940,9 +2938,8 @@ sh_coff_get_relocated_section_contents (bfd *output_bfd,
       if (! _bfd_coff_get_external_symbols (input_bfd))
        goto error_return;
 
-      internal_relocs = (_bfd_coff_read_internal_relocs
-                        (input_bfd, input_section, false, (bfd_byte *) NULL,
-                         false, (struct internal_reloc *) NULL));
+      internal_relocs = (bfd_coff_read_internal_relocs
+                        (input_bfd, input_section, false, NULL, false, NULL));
       if (internal_relocs == NULL)
        goto error_return;
 
index a851a22c22e55956f2b371ff820da1487d3b4d5e..ce8d5f77617ec14b330b9d8d099c3357805597d3 100644 (file)
@@ -596,12 +596,12 @@ _bfd_coff_internal_syment_name (bfd *abfd,
    value must be INTERNAL_RELOCS.  The function returns NULL on error.  */
 
 struct internal_reloc *
-_bfd_coff_read_internal_relocs (bfd *abfd,
-                               asection *sec,
-                               bool cache,
-                               bfd_byte *external_relocs,
-                               bool require_internal,
-                               struct internal_reloc *internal_relocs)
+bfd_coff_read_internal_relocs (bfd *abfd,
+                              asection *sec,
+                              bool cache,
+                              bfd_byte *external_relocs,
+                              bool require_internal,
+                              struct internal_reloc *internal_relocs)
 {
   bfd_size_type relsz;
   bfd_byte *free_external = NULL;
@@ -2872,8 +2872,8 @@ init_reloc_cookie_rels (struct coff_reloc_cookie *cookie,
       return true;
     }
 
-  cookie->rels = _bfd_coff_read_internal_relocs (abfd, sec, false, NULL,
-                                                0, NULL);
+  cookie->rels = bfd_coff_read_internal_relocs (abfd, sec, false, NULL,
+                                               false, NULL);
 
   if (cookie->rels == NULL)
     return false;
index d1658ac1e89f9b416cfb262a4403e96466f14d1e..8fabcf7028ad7fe12f06203b606a300a0046f2a6 100644 (file)
@@ -1377,7 +1377,7 @@ mark_relocs (struct coff_final_link_info *flaginfo, bfd *input_bfd)
        continue;
 
       /* Read in the relocs.  */
-      internal_relocs = _bfd_coff_read_internal_relocs
+      internal_relocs = bfd_coff_read_internal_relocs
        (input_bfd, a, false,
         flaginfo->external_relocs,
         bfd_link_relocatable (flaginfo->info),
@@ -2391,7 +2391,7 @@ _bfd_coff_link_input_bfd (struct coff_final_link_info *flaginfo, bfd *input_bfd)
 
          /* Read in the relocs.  */
          target_index = o->output_section->target_index;
-         internal_relocs = (_bfd_coff_read_internal_relocs
+         internal_relocs = (bfd_coff_read_internal_relocs
                             (input_bfd, o, false, flaginfo->external_relocs,
                              bfd_link_relocatable (flaginfo->info),
                              (bfd_link_relocatable (flaginfo->info)
index 88f5760b5428f3a671116f32f295f64bd9ef9b20..a415cfeea255a19784a76bc73feadbb13582935d 100644 (file)
@@ -622,7 +622,7 @@ extern bool _bfd_coff_link_add_symbols
   (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
 extern bool _bfd_coff_final_link
   (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
-extern struct internal_reloc *_bfd_coff_read_internal_relocs
+extern struct internal_reloc *bfd_coff_read_internal_relocs
   (bfd *, asection *, bool, bfd_byte *, bool,
    struct internal_reloc *);
 extern bool _bfd_coff_generic_relocate_section
index d2d550174dab585bd8970eb40d5bf155bc82da1f..6d25fe97478745a67e427777f4c680aadcf5dd8f 100644 (file)
@@ -626,7 +626,7 @@ extern bool _bfd_coff_link_add_symbols
   (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
 extern bool _bfd_coff_final_link
   (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
-extern struct internal_reloc *_bfd_coff_read_internal_relocs
+extern struct internal_reloc *bfd_coff_read_internal_relocs
   (bfd *, asection *, bool, bfd_byte *, bool,
    struct internal_reloc *);
 extern bool _bfd_coff_generic_relocate_section
index b50b17fab1c1dc392f621ddbf14e833781765e81..14936aaf4d5835245fbc1019bf4e7236b9a34c20 100644 (file)
@@ -711,7 +711,7 @@ _bfd_xcoff_bfd_link_hash_table_create (bfd *abfd)
 }
 \f
 /* Read internal relocs for an XCOFF csect.  This is a wrapper around
-   _bfd_coff_read_internal_relocs which tries to take advantage of any
+   bfd_coff_read_internal_relocs which tries to take advantage of any
    relocs which may have been cached for the enclosing section.  */
 
 static struct internal_reloc *
@@ -736,8 +736,8 @@ xcoff_read_internal_relocs (bfd *abfd,
          && cache
          && enclosing->reloc_count > 0)
        {
-         if (_bfd_coff_read_internal_relocs (abfd, enclosing, true,
-                                             external_relocs, false, NULL)
+         if (bfd_coff_read_internal_relocs (abfd, enclosing, true,
+                                            external_relocs, false, NULL)
              == NULL)
            return NULL;
        }
@@ -760,8 +760,8 @@ xcoff_read_internal_relocs (bfd *abfd,
        }
     }
 
-  return _bfd_coff_read_internal_relocs (abfd, sec, cache, external_relocs,
-                                        require_internal, internal_relocs);
+  return bfd_coff_read_internal_relocs (abfd, sec, cache, external_relocs,
+                                       require_internal, internal_relocs);
 }
 \f
 /* Split FILENAME into an import path and an import filename,
index d0d51c7a79ada908cc3c4b91d183d93c05fff3bb..9785f7bbd115bf61d7cd423ee92ea8ca23ac8705 100644 (file)
--- a/ld/pdb.c
+++ b/ld/pdb.c
@@ -1946,8 +1946,7 @@ handle_debugs_section (asection *s, bfd *mod, struct string_table *strings,
 
       syment_count = obj_raw_syment_count (mod);
 
-      relocs =
-       _bfd_coff_read_internal_relocs (mod, s, false, NULL, true, NULL);
+      relocs = bfd_coff_read_internal_relocs (mod, s, false, NULL, true, NULL);
 
       symbols = xmalloc (sizeof (struct internal_syment) * syment_count);
       sectlist = xmalloc (sizeof (asection *) * syment_count);