From: Jan Beulich Date: Fri, 7 Nov 2025 14:00:51 +0000 (+0100) Subject: bfd/ELF: _bfd_elf_link_create_dynamic_sections() is exposed to ld X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97df0abb93ff1cf44579c9338dc4a0c94260bf62;p=thirdparty%2Fbinutils-gdb.git bfd/ELF: _bfd_elf_link_create_dynamic_sections() is exposed to ld 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. --- diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index daad1a938f0..cb708147ef3 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -2625,7 +2625,7 @@ extern unsigned int _bfd_elf_default_action_discarded 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; diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c index 6fa1a79ee87..5f6e9b41841 100644 --- 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, diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c index a31c381531e..98b3a894ee5 100644 --- a/bfd/elf32-tic6x.c +++ b/bfd/elf32-tic6x.c @@ -2694,7 +2694,7 @@ elf32_tic6x_check_relocs (bfd *abfd, struct bfd_link_info *info, 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; } diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c index 2d06396fb16..582c28f718f 100644 --- a/bfd/elf64-hppa.c +++ b/bfd/elf64-hppa.c @@ -507,7 +507,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; } diff --git a/bfd/elflink.c b/bfd/elflink.c index e2f5425ba39..359d1c59248 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -332,7 +332,7 @@ _bfd_elf_link_create_dynstrtab (bfd *abfd, struct bfd_link_info *info) 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; @@ -3960,7 +3960,7 @@ bfd_elf_add_dt_needed_tag (bfd *abfd, struct bfd_link_info *info) } } - 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)) @@ -4577,7 +4577,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) && 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; } } @@ -4798,7 +4798,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) /* 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. */ @@ -5739,7 +5739,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) /* 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; } @@ -11711,7 +11711,7 @@ elf_link_input_bfd (struct elf_final_link_info *flinfo, bfd *input_bfd) 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; } @@ -13778,7 +13778,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) 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) diff --git a/ld/emultempl/vxworks.em b/ld/emultempl/vxworks.em index cd2f6a5a034..61dcfabbae7 100644 --- 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