From: Alan Modra Date: Wed, 26 Nov 2025 22:31:31 +0000 (+1030) Subject: PR 33453 backend_finish_dynamic_sections final link buffer X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8906c4e3b729ad04f9d058cd9abde788ad945c33;p=thirdparty%2Fbinutils-gdb.git PR 33453 backend_finish_dynamic_sections final link buffer This adds a pointer parameter to backend_finish_dynamic_sections, to give the function access to the final link section contents buffer. The patch is entirely mechanical changes in preparation for the next patch. No use is made of the buffer here. --- diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index b0f16fd1871..d1368ece901 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -1305,7 +1305,7 @@ struct elf_backend_data output file. The FINISH_DYNAMIC_SYMBOL will have been called on all dynamic symbols. */ bool (*elf_backend_finish_dynamic_sections) - (bfd *output_bfd, struct bfd_link_info *info); + (bfd *output_bfd, struct bfd_link_info *info, bfd_byte *); /* A function to do any beginning processing needed for the ELF file before building the ELF headers and computing file positions. */ diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c index c2ed6e87a91..7ffc9d68711 100644 --- a/bfd/elf-m10300.c +++ b/bfd/elf-m10300.c @@ -5336,8 +5336,9 @@ _bfd_mn10300_elf_finish_dynamic_symbol (bfd * output_bfd, /* Finish up the dynamic sections. */ static bool -_bfd_mn10300_elf_finish_dynamic_sections (bfd * output_bfd, - struct bfd_link_info * info) +_bfd_mn10300_elf_finish_dynamic_sections (bfd *output_bfd, + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd * dynobj; asection * sgot; diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c index b5c2d9bd1da..c1a9fb699a4 100644 --- a/bfd/elf32-arc.c +++ b/bfd/elf32-arc.c @@ -2580,7 +2580,8 @@ arc_create_forced_local_got_entries_for_tls (struct bfd_hash_entry *bh, static bool elf_arc_finish_dynamic_sections (bfd * output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { struct elf_link_hash_table *htab = elf_hash_table (info); bfd *dynobj = (elf_hash_table (info))->dynobj; diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 16a7544bf17..24dde624d55 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -17217,7 +17217,8 @@ arm_put_trampoline (struct elf32_arm_link_hash_table *htab, bfd *output_bfd, /* Finish up the dynamic sections. */ static bool -elf32_arm_finish_dynamic_sections (bfd * output_bfd, struct bfd_link_info * info) +elf32_arm_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd * dynobj; asection * sgot; diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c index a3f66ab138e..279e31b56c6 100644 --- a/bfd/elf32-bfin.c +++ b/bfd/elf32-bfin.c @@ -4218,7 +4218,8 @@ bfinfdpic_elf_discard_info (bfd *ibfd, static bool elf32_bfinfdpic_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd *dynobj; asection *sdyn; @@ -4861,7 +4862,8 @@ bfin_link_hash_table_create (bfd * abfd) static bool bfin_finish_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd *dynobj; asection *sdyn; diff --git a/bfd/elf32-cr16.c b/bfd/elf32-cr16.c index 9ddf654078c..06ba71ac1c4 100644 --- a/bfd/elf32-cr16.c +++ b/bfd/elf32-cr16.c @@ -2579,8 +2579,9 @@ _bfd_cr16_elf_finish_dynamic_symbol (bfd * output_bfd, /* Finish up the dynamic sections. */ static bool -_bfd_cr16_elf_finish_dynamic_sections (bfd * output_bfd, - struct bfd_link_info * info) +_bfd_cr16_elf_finish_dynamic_sections (bfd *output_bfd, + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd * dynobj; asection * sgot; diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c index 7d90b836e35..463ac32f3ea 100644 --- a/bfd/elf32-cris.c +++ b/bfd/elf32-cris.c @@ -2310,7 +2310,8 @@ elf_cris_finish_dynamic_symbol (bfd *output_bfd, static bool elf_cris_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd *dynobj; asection *sgot; diff --git a/bfd/elf32-csky.c b/bfd/elf32-csky.c index 239cf72fdb0..d648ed5b960 100644 --- a/bfd/elf32-csky.c +++ b/bfd/elf32-csky.c @@ -2272,7 +2272,8 @@ csky_elf_finish_dynamic_symbol (bfd *output_bfd, static bool csky_elf_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { struct csky_elf_link_hash_table *htab; bfd *dynobj; diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c index 7dd354b8eac..5a0c3e67834 100644 --- a/bfd/elf32-frv.c +++ b/bfd/elf32-frv.c @@ -5685,7 +5685,8 @@ elf32_frvfdpic_relax_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, static bool elf32_frv_finish_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, - struct bfd_link_info *info ATTRIBUTE_UNUSED) + struct bfd_link_info *info ATTRIBUTE_UNUSED, + bfd_byte *buf ATTRIBUTE_UNUSED) { /* Nothing to be done for non-FDPIC. */ return true; @@ -5693,7 +5694,8 @@ elf32_frv_finish_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, static bool elf32_frvfdpic_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd *dynobj; asection *sdyn; diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index 4721cad619a..daafff74f82 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -4369,7 +4369,8 @@ elf32_hppa_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED, static bool elf32_hppa_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd *dynobj; struct elf32_hppa_link_hash_table *htab; diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index c8871334427..abb361be993 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -4137,11 +4137,12 @@ elf_i386_reloc_type_class (const struct bfd_link_info *info, static bool elf_i386_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf) { struct elf_x86_link_hash_table *htab; - htab = _bfd_x86_elf_finish_dynamic_sections (output_bfd, info); + htab = _bfd_x86_elf_finish_dynamic_sections (output_bfd, info, buf); if (htab == NULL) return false; diff --git a/bfd/elf32-lm32.c b/bfd/elf32-lm32.c index ec916aaf1b4..71978065b95 100644 --- a/bfd/elf32-lm32.c +++ b/bfd/elf32-lm32.c @@ -1257,7 +1257,8 @@ lm32_elf_check_relocs (bfd *abfd, static bool lm32_elf_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { struct elf_lm32_link_hash_table *htab; bfd *dynobj; diff --git a/bfd/elf32-m32c.c b/bfd/elf32-m32c.c index 93cd2d525d9..bbc1225178e 100644 --- a/bfd/elf32-m32c.c +++ b/bfd/elf32-m32c.c @@ -751,7 +751,8 @@ m32c_elf_check_relocs static bool m32c_elf_finish_dynamic_sections (bfd *abfd ATTRIBUTE_UNUSED, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd *dynobj = elf_hash_table (info)->dynobj; asection *splt = elf_hash_table (info)->splt; diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c index f21939bf774..02a563efacf 100644 --- a/bfd/elf32-m32r.c +++ b/bfd/elf32-m32r.c @@ -3067,7 +3067,8 @@ m32r_elf_finish_dynamic_symbol (bfd *output_bfd, static bool m32r_elf_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { struct elf_link_hash_table *htab; bfd *dynobj; diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c index 41bc5aef0aa..efe98b59f39 100644 --- a/bfd/elf32-m68k.c +++ b/bfd/elf32-m68k.c @@ -4270,7 +4270,8 @@ elf_m68k_finish_dynamic_symbol (bfd *output_bfd, /* Finish up the dynamic sections. */ static bool -elf_m68k_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) +elf_m68k_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd *dynobj; asection *sgot; diff --git a/bfd/elf32-metag.c b/bfd/elf32-metag.c index ca95aad17e8..65a9e6f44a1 100644 --- a/bfd/elf32-metag.c +++ b/bfd/elf32-metag.c @@ -3104,7 +3104,8 @@ elf_metag_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED, static bool elf_metag_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd *dynobj; struct elf_metag_link_hash_table *htab; diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c index ede21310cf2..e13383963ad 100644 --- a/bfd/elf32-microblaze.c +++ b/bfd/elf32-microblaze.c @@ -3320,7 +3320,8 @@ microblaze_elf_finish_dynamic_symbol (bfd *output_bfd, static bool microblaze_elf_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd *dynobj; asection *sdyn, *sgot; diff --git a/bfd/elf32-nds32.c b/bfd/elf32-nds32.c index 2341939e2a7..acfc659773d 100644 --- a/bfd/elf32-nds32.c +++ b/bfd/elf32-nds32.c @@ -6344,7 +6344,8 @@ nds32_elf_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info, /* Finish up the dynamic sections. */ static bool -nds32_elf_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) +nds32_elf_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd *dynobj; asection *sdyn; diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c index 10abd878c1c..e6e25a875d4 100644 --- a/bfd/elf32-or1k.c +++ b/bfd/elf32-or1k.c @@ -2320,7 +2320,8 @@ or1k_write_plt_entry (bfd *output_bfd, bfd_byte *contents, unsigned insnj, static bool or1k_elf_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd *dynobj; asection *sdyn, *sgot; diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index dd094357c1c..6ed220d572c 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -9920,7 +9920,8 @@ ppc_elf_reloc_type_class (const struct bfd_link_info *info, static bool ppc_elf_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { asection *sdyn; struct ppc_elf_link_hash_table *htab; diff --git a/bfd/elf32-rl78.c b/bfd/elf32-rl78.c index b44fabbcdbe..16897ccad90 100644 --- a/bfd/elf32-rl78.c +++ b/bfd/elf32-rl78.c @@ -1409,7 +1409,8 @@ rl78_elf_check_relocs static bool rl78_elf_finish_dynamic_sections (bfd *abfd ATTRIBUTE_UNUSED, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd *dynobj; asection *splt; diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c index b53d1a49dd3..5e0c783b39a 100644 --- a/bfd/elf32-s390.c +++ b/bfd/elf32-s390.c @@ -3610,7 +3610,8 @@ elf_s390_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED, static bool elf_s390_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { struct elf_s390_link_hash_table *htab; bfd *dynobj; diff --git a/bfd/elf32-score.c b/bfd/elf32-score.c index 7084e4d9f4f..684144f39a6 100644 --- a/bfd/elf32-score.c +++ b/bfd/elf32-score.c @@ -3550,7 +3550,8 @@ s3_bfd_score_elf_finish_dynamic_symbol (bfd *output_bfd, /* Finish up the dynamic sections. */ static bool s3_bfd_score_elf_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd *dynobj; asection *sdyn; @@ -4216,12 +4217,13 @@ _bfd_score_elf_finish_dynamic_symbol (bfd *output_bfd, static bool _bfd_score_elf_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf) { if (bfd_get_mach (output_bfd) == bfd_mach_score3) - return s3_bfd_score_elf_finish_dynamic_sections (output_bfd, info); + return s3_bfd_score_elf_finish_dynamic_sections (output_bfd, info, buf); else - return s7_bfd_score_elf_finish_dynamic_sections (output_bfd, info); + return s7_bfd_score_elf_finish_dynamic_sections (output_bfd, info, buf); } static bool diff --git a/bfd/elf32-score.h b/bfd/elf32-score.h index 0dee807c9c1..b982ed9babf 100644 --- a/bfd/elf32-score.h +++ b/bfd/elf32-score.h @@ -99,8 +99,8 @@ s7_bfd_score_elf_finish_dynamic_symbol (bfd *, Elf_Internal_Sym *) ATTRIBUTE_HIDDEN; extern bool -s7_bfd_score_elf_finish_dynamic_sections (bfd *, struct bfd_link_info *) - ATTRIBUTE_HIDDEN; +s7_bfd_score_elf_finish_dynamic_sections (bfd *, struct bfd_link_info *, + bfd_byte *) ATTRIBUTE_HIDDEN; extern bool s7_bfd_score_elf_fake_sections (bfd *, diff --git a/bfd/elf32-score7.c b/bfd/elf32-score7.c index eb8b1eb15aa..a74c7279bce 100644 --- a/bfd/elf32-score7.c +++ b/bfd/elf32-score7.c @@ -3362,7 +3362,8 @@ s7_bfd_score_elf_finish_dynamic_symbol (bfd *output_bfd, bool s7_bfd_score_elf_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd *dynobj; asection *sdyn; diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index da00593e96d..7df228de591 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -6245,7 +6245,8 @@ sh_elf_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info, /* Finish up the dynamic sections. */ static bool -sh_elf_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) +sh_elf_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { struct elf_sh_link_hash_table *htab; asection *sgotplt; diff --git a/bfd/elf32-spu.c b/bfd/elf32-spu.c index adea6d0d51c..00cf73fd108 100644 --- a/bfd/elf32-spu.c +++ b/bfd/elf32-spu.c @@ -5135,7 +5135,8 @@ spu_elf_relocate_section (bfd *output_bfd, static bool spu_elf_finish_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, - struct bfd_link_info *info ATTRIBUTE_UNUSED) + struct bfd_link_info *info ATTRIBUTE_UNUSED, + bfd_byte *buf ATTRIBUTE_UNUSED) { return true; } diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c index 564bb72b3e8..c3a434ef83b 100644 --- a/bfd/elf32-tic6x.c +++ b/bfd/elf32-tic6x.c @@ -3362,7 +3362,8 @@ elf32_tic6x_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) static bool elf32_tic6x_finish_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { struct elf32_tic6x_link_hash_table *htab; bfd *dynobj; diff --git a/bfd/elf32-tilepro.c b/bfd/elf32-tilepro.c index 05746e9d6b6..63aa148bc80 100644 --- a/bfd/elf32-tilepro.c +++ b/bfd/elf32-tilepro.c @@ -3581,7 +3581,8 @@ tilepro_finish_dyn (bfd *output_bfd, struct bfd_link_info *info, static bool tilepro_elf_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd *dynobj; asection *sdyn; diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c index 8d5c18d00f8..0d0bb0d8b15 100644 --- a/bfd/elf32-vax.c +++ b/bfd/elf32-vax.c @@ -43,7 +43,8 @@ static int elf_vax_relocate_section (bfd *, struct bfd_link_info *, static bool elf_vax_finish_dynamic_symbol (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, Elf_Internal_Sym *); -static bool elf_vax_finish_dynamic_sections (bfd *, struct bfd_link_info *); +static bool elf_vax_finish_dynamic_sections (bfd *, struct bfd_link_info *, + bfd_byte *); static bfd_vma elf_vax_plt_sym_val (bfd_vma, const asection *, const arelent *); @@ -1733,7 +1734,8 @@ elf_vax_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info, /* Finish up the dynamic sections. */ static bool -elf_vax_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) +elf_vax_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd *dynobj; asection *sgot; diff --git a/bfd/elf32-xstormy16.c b/bfd/elf32-xstormy16.c index 471eb2e6c91..7f330eb3748 100644 --- a/bfd/elf32-xstormy16.c +++ b/bfd/elf32-xstormy16.c @@ -958,7 +958,8 @@ xstormy16_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, static bool xstormy16_elf_finish_dynamic_sections (bfd *abfd ATTRIBUTE_UNUSED, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd *dynobj = elf_hash_table (info)->dynobj; asection *splt = elf_hash_table (info)->splt; diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c index 20b6292c14e..403e218a3b3 100644 --- a/bfd/elf32-xtensa.c +++ b/bfd/elf32-xtensa.c @@ -3215,7 +3215,8 @@ elf_xtensa_combine_prop_entries (bfd *output_bfd, static bool elf_xtensa_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { struct elf_xtensa_link_hash_table *htab; bfd *dynobj; diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index 077539bdcfd..932f65df07c 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -4905,7 +4905,8 @@ elf64_alpha_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info, static bool elf64_alpha_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd *dynobj; asection *sdyn; diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c index befe6fc3a5b..026c8a60956 100644 --- a/bfd/elf64-hppa.c +++ b/bfd/elf64-hppa.c @@ -192,7 +192,7 @@ static bool elf64_hppa_finish_dynamic_symbol struct elf_link_hash_entry *, Elf_Internal_Sym *); static bool elf64_hppa_finish_dynamic_sections - (bfd *, struct bfd_link_info *); + (bfd *, struct bfd_link_info *, bfd_byte *); static bool elf64_hppa_check_relocs (bfd *, struct bfd_link_info *, @@ -2424,7 +2424,8 @@ elf64_hppa_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED, static bool elf64_hppa_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd *dynobj; asection *sdyn; diff --git a/bfd/elf64-ia64-vms.c b/bfd/elf64-ia64-vms.c index 538b7237c6b..74f1551fbdd 100644 --- a/bfd/elf64-ia64-vms.c +++ b/bfd/elf64-ia64-vms.c @@ -4054,7 +4054,8 @@ elf64_ia64_finish_dynamic_symbol (bfd *output_bfd, static bool elf64_ia64_finish_dynamic_sections (bfd *abfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { struct elf64_ia64_link_hash_table *ia64_info; bfd *dynobj; diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 818609142ef..48af990e9e4 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -18248,7 +18248,8 @@ ppc64_elf_reloc_type_class (const struct bfd_link_info *info, static bool ppc64_elf_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { struct ppc_link_hash_table *htab; bfd *dynobj; diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c index 5df77f2fe88..decd742a8d5 100644 --- a/bfd/elf64-s390.c +++ b/bfd/elf64-s390.c @@ -3841,7 +3841,8 @@ elf_s390_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED, static bool elf_s390_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { struct elf_s390_link_hash_table *htab; bfd *dynobj; diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 26c6f0efc4c..337394fc478 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -5651,11 +5651,12 @@ elf_x86_64_reloc_type_class (const struct bfd_link_info *info, static bool elf_x86_64_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf) { struct elf_x86_link_hash_table *htab; - htab = _bfd_x86_elf_finish_dynamic_sections (output_bfd, info); + htab = _bfd_x86_elf_finish_dynamic_sections (output_bfd, info, buf); if (htab == NULL) return false; diff --git a/bfd/elflink.c b/bfd/elflink.c index fb975d91803..7a5f54b926f 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -13737,7 +13737,8 @@ _bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) /* If we have created any dynamic sections, then output them. */ if (dynobj != NULL) { - if (! (*bed->elf_backend_finish_dynamic_sections) (abfd, info)) + if (! (*bed->elf_backend_finish_dynamic_sections) (abfd, info, + flinfo.contents)) goto error_return; /* Check for DT_TEXTREL (late, in case the backend removes it). */ diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index 89cf50bf2a7..b104e40d1ab 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -10219,7 +10219,8 @@ elfNN_aarch64_init_small_plt0_entry (bfd *output_bfd ATTRIBUTE_UNUSED, static bool elfNN_aarch64_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { struct elf_aarch64_link_hash_table *htab; bfd *dynobj; diff --git a/bfd/elfnn-ia64.c b/bfd/elfnn-ia64.c index e0c3a8c9428..43113cabccf 100644 --- a/bfd/elfnn-ia64.c +++ b/bfd/elfnn-ia64.c @@ -4597,7 +4597,8 @@ elfNN_ia64_finish_dynamic_symbol (bfd *output_bfd, static bool elfNN_ia64_finish_dynamic_sections (bfd *abfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { struct elfNN_ia64_link_hash_table *ia64_info; bfd *dynobj; diff --git a/bfd/elfnn-kvx.c b/bfd/elfnn-kvx.c index 853ccfd0e95..297785fe05d 100644 --- a/bfd/elfnn-kvx.c +++ b/bfd/elfnn-kvx.c @@ -4548,7 +4548,8 @@ elfNN_kvx_init_small_plt0_entry (bfd *output_bfd ATTRIBUTE_UNUSED, static bool elfNN_kvx_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { struct elf_kvx_link_hash_table *htab; bfd *dynobj; diff --git a/bfd/elfnn-loongarch.c b/bfd/elfnn-loongarch.c index a2d40a8e023..ddb809760ab 100644 --- a/bfd/elfnn-loongarch.c +++ b/bfd/elfnn-loongarch.c @@ -6348,7 +6348,8 @@ elf_loongarch_output_arch_local_syms static bool loongarch_elf_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd *dynobj; asection *sdyn, *plt, *gotplt = NULL; diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c index a81a99014b3..345b3bb96fd 100644 --- a/bfd/elfnn-riscv.c +++ b/bfd/elfnn-riscv.c @@ -3760,7 +3760,8 @@ riscv_finish_dyn (bfd *output_bfd, struct bfd_link_info *info, static bool riscv_elf_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd *dynobj; asection *sdyn; diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index b8809a4b1da..e37c45fec15 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -11929,7 +11929,8 @@ mips_vxworks_finish_shared_plt (bfd *output_bfd, struct bfd_link_info *info) bool _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd *dynobj; asection *sdyn; diff --git a/bfd/elfxx-mips.h b/bfd/elfxx-mips.h index 33e02b7bb67..55f8a964db9 100644 --- a/bfd/elfxx-mips.h +++ b/bfd/elfxx-mips.h @@ -80,7 +80,7 @@ extern bool _bfd_mips_vxworks_finish_dynamic_symbol (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, Elf_Internal_Sym *) ATTRIBUTE_HIDDEN; extern bool _bfd_mips_elf_finish_dynamic_sections - (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN; + (bfd *, struct bfd_link_info *, bfd_byte *) ATTRIBUTE_HIDDEN; extern bool _bfd_mips_elf_sort_relocs_p (asection *) ATTRIBUTE_HIDDEN; extern void _bfd_mips_final_write_processing diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c index 0a80e7c7f5a..bd1dcf78b62 100644 --- a/bfd/elfxx-sparc.c +++ b/bfd/elfxx-sparc.c @@ -4696,7 +4696,9 @@ pie_finish_undefweak_symbol (struct bfd_hash_entry *bh, } bool -_bfd_sparc_elf_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) +_bfd_sparc_elf_finish_dynamic_sections (bfd *output_bfd, + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd *dynobj; asection *sdyn; diff --git a/bfd/elfxx-sparc.h b/bfd/elfxx-sparc.h index 26fec7566e8..16abaa9a86b 100644 --- a/bfd/elfxx-sparc.h +++ b/bfd/elfxx-sparc.h @@ -127,7 +127,7 @@ extern bool _bfd_sparc_elf_finish_dynamic_symbol (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, Elf_Internal_Sym *sym) ATTRIBUTE_HIDDEN; extern bool _bfd_sparc_elf_finish_dynamic_sections - (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN; + (bfd *, struct bfd_link_info *, bfd_byte *) ATTRIBUTE_HIDDEN; extern bool _bfd_sparc_elf_fixup_symbol (struct bfd_link_info *, struct elf_link_hash_entry *) ATTRIBUTE_HIDDEN; extern bool _bfd_sparc_elf_object_p diff --git a/bfd/elfxx-tilegx.c b/bfd/elfxx-tilegx.c index cdbeac1a30c..29371693dfd 100644 --- a/bfd/elfxx-tilegx.c +++ b/bfd/elfxx-tilegx.c @@ -3960,7 +3960,8 @@ tilegx_finish_dyn (bfd *output_bfd, struct bfd_link_info *info, bool tilegx_elf_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { bfd *dynobj; asection *sdyn; diff --git a/bfd/elfxx-tilegx.h b/bfd/elfxx-tilegx.h index c6a560a604f..38713c35e0b 100644 --- a/bfd/elfxx-tilegx.h +++ b/bfd/elfxx-tilegx.h @@ -95,7 +95,7 @@ tilegx_elf_finish_dynamic_symbol (bfd *, Elf_Internal_Sym *) ATTRIBUTE_HIDDEN; extern bool -tilegx_elf_finish_dynamic_sections (bfd *, struct bfd_link_info *) +tilegx_elf_finish_dynamic_sections (bfd *, struct bfd_link_info *, bfd_byte *) ATTRIBUTE_HIDDEN; extern bool diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c index 1f7024f09c7..67fba0fa553 100644 --- a/bfd/elfxx-x86.c +++ b/bfd/elfxx-x86.c @@ -2762,7 +2762,8 @@ _bfd_x86_elf_late_size_sections (bfd *output_bfd, struct elf_x86_link_hash_table * _bfd_x86_elf_finish_dynamic_sections (bfd *output_bfd, - struct bfd_link_info *info) + struct bfd_link_info *info, + bfd_byte *buf ATTRIBUTE_UNUSED) { struct elf_x86_link_hash_table *htab; const struct elf_backend_data *bed; diff --git a/bfd/elfxx-x86.h b/bfd/elfxx-x86.h index 9ed1864b9cc..7e196cd0475 100644 --- a/bfd/elfxx-x86.h +++ b/bfd/elfxx-x86.h @@ -884,7 +884,7 @@ extern bool _bfd_x86_elf_late_size_sections (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN; extern struct elf_x86_link_hash_table *_bfd_x86_elf_finish_dynamic_sections - (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN; + (bfd *, struct bfd_link_info *, bfd_byte *) ATTRIBUTE_HIDDEN; extern bool _bfd_x86_elf_early_size_sections (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;