[PATCH 26/27] bfd/ELF: _bfd_elf_link_create_dynamic_sections() is exposed to ld

Jan Beulich jbeulich@suse.com
Mon Oct 27 14:25:06 GMT 2025
As a non-private function, it shouldn't have "_bfd_" prefixes, but merely
a "bfd_" one. Even if, sadly, it needs exposing just for the sake for
VxWorks.

--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -2620,7 +2620,7 @@ extern unsigned int _bfd_elf_default_act
 extern struct bfd_section *bfd_elf_tls_setup
   (bfd *, struct bfd_link_info *);
 
-extern bool _bfd_elf_link_create_dynamic_sections
+extern bool bfd_elf_link_create_dynamic_sections
   (bfd *, struct bfd_link_info *);
 extern bool _bfd_elf_omit_section_dynsym_default
   (bfd *, struct bfd_link_info *, asection *) ATTRIBUTE_HIDDEN;
--- a/bfd/elf32-arc.c
+++ b/bfd/elf32-arc.c
@@ -2071,7 +2071,7 @@ elf_arc_check_relocs (bfd *			 abfd,
 		  {
 		    if (info->dynamic
 			&& ! htab->dynamic_sections_created
-			&& ! _bfd_elf_link_create_dynamic_sections (abfd, info))
+			&& ! bfd_elf_link_create_dynamic_sections (abfd, info))
 		      return false;
 		    sreloc = _bfd_elf_make_dynamic_reloc_section (sec, dynobj,
 								  2, abfd,
--- a/bfd/elf32-tic6x.c
+++ b/bfd/elf32-tic6x.c
@@ -2694,7 +2694,7 @@ elf32_tic6x_check_relocs (bfd *abfd, str
   if ((bfd_link_pic (info) || elf32_tic6x_using_dsbt (abfd))
       && ! htab->elf.dynamic_sections_created)
     {
-      if (! _bfd_elf_link_create_dynamic_sections (abfd, info))
+      if (! bfd_elf_link_create_dynamic_sections (abfd, info))
 	return false;
     }
 
--- a/bfd/elf64-hppa.c
+++ b/bfd/elf64-hppa.c
@@ -526,7 +526,7 @@ elf64_hppa_check_relocs (bfd *abfd,
      the special sections required for dynamic linking.  */
   if (! elf_hash_table (info)->dynamic_sections_created)
     {
-      if (! _bfd_elf_link_create_dynamic_sections (abfd, info))
+      if (! bfd_elf_link_create_dynamic_sections (abfd, info))
 	return false;
     }
 
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -311,7 +311,7 @@ _bfd_elf_link_create_dynstrtab (bfd *abf
    actual contents and size of these sections later.  */
 
 bool
-_bfd_elf_link_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
+bfd_elf_link_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
 {
   flagword flags;
   asection *s;
@@ -3939,7 +3939,7 @@ bfd_elf_add_dt_needed_tag (bfd *abfd, st
 	  }
     }
 
-  if (!_bfd_elf_link_create_dynamic_sections (hash_table->dynobj, info))
+  if (!bfd_elf_link_create_dynamic_sections (hash_table->dynobj, info))
     return -1;
 
   if (!_bfd_elf_add_dynamic_entry (info, DT_NEEDED, strindex))
@@ -4556,7 +4556,7 @@ elf_link_add_object_symbols (bfd *abfd,
 	  && info->output_bfd->xvec == abfd->xvec
 	  && !htab->dynamic_sections_created)
 	{
-	  if (! _bfd_elf_link_create_dynamic_sections (abfd, info))
+	  if (!bfd_elf_link_create_dynamic_sections (abfd, info))
 	    goto error_return;
 	}
     }
@@ -4777,7 +4777,7 @@ elf_link_add_object_symbols (bfd *abfd,
       /* Create dynamic sections for backends that require that be done
 	 before setup_gnu_properties.  */
       if (add_needed
-	  && !_bfd_elf_link_create_dynamic_sections (abfd, info))
+	  && !bfd_elf_link_create_dynamic_sections (abfd, info))
 	return false;
 
       /* Save the DT_AUDIT entry for the linker emulation code. */
@@ -5719,7 +5719,7 @@ elf_link_add_object_symbols (bfd *abfd,
 
 		  /* Create dynamic sections for backends that require
 		     that be done before setup_gnu_properties.  */
-		  if (!_bfd_elf_link_create_dynamic_sections (abfd, info))
+		  if (!bfd_elf_link_create_dynamic_sections (abfd, info))
 		    goto error_free_vers;
 		  add_needed = true;
 		}
@@ -11670,7 +11670,7 @@ elf_link_input_bfd (struct elf_final_lin
 
       if ((o->flags & SEC_LINKER_CREATED) != 0)
 	{
-	  /* Section was created by _bfd_elf_link_create_dynamic_sections
+	  /* Section was created by bfd_elf_link_create_dynamic_sections()
 	     or somesuch.  */
 	  continue;
 	}
@@ -13736,7 +13736,7 @@ bfd_elf_final_link (bfd *abfd, struct bf
 	  if ((o->flags & SEC_LINKER_CREATED) == 0)
 	    {
 	      /* At this point, we are only interested in sections
-		 created by _bfd_elf_link_create_dynamic_sections.  */
+		 created by bfd_elf_link_create_dynamic_sections().  */
 	      continue;
 	    }
 	  if (htab->stab_info.stabstr == o)
--- a/ld/emultempl/vxworks.em
+++ b/ld/emultempl/vxworks.em
@@ -42,8 +42,8 @@ vxworks_after_open (void)
   if (force_dynamic
       && link_info.input_bfds
       && bfd_get_flavour (link_info.output_bfd) == bfd_target_elf_flavour
-      && !_bfd_elf_link_create_dynamic_sections (link_info.input_bfds,
-						 &link_info))
+      && !bfd_elf_link_create_dynamic_sections (link_info.input_bfds,
+						&link_info))
     einfo (_("%X%P: cannot create dynamic sections %E\n"));
 
   if (!force_dynamic



More information about the Binutils mailing list