diff options
Diffstat (limited to 'toolchain/binutils')
51 files changed, 233 insertions, 13913 deletions
diff --git a/toolchain/binutils/Config.in b/toolchain/binutils/Config.in index caa9bcde8b..87a59d7c11 100644 --- a/toolchain/binutils/Config.in +++ b/toolchain/binutils/Config.in @@ -2,33 +2,25 @@ choice prompt "Binutils Version" if TOOLCHAINOPTS - default BINUTILS_USE_VERSION_2_42 + default BINUTILS_USE_VERSION_2_44 help Select the version of binutils you wish to use. - config BINUTILS_USE_VERSION_2_37 - bool "Binutils 2.37" - select BINUTILS_VERSION_2_37 - - config BINUTILS_USE_VERSION_2_38 - bool "Binutils 2.38" - select BINUTILS_VERSION_2_38 - - config BINUTILS_USE_VERSION_2_39 - bool "Binutils 2.39" - select BINUTILS_VERSION_2_39 - - config BINUTILS_USE_VERSION_2_40 - bool "Binutils 2.40" - select BINUTILS_VERSION_2_40 - - config BINUTILS_USE_VERSION_2_41 - bool "Binutils 2.41" - select BINUTILS_VERSION_2_41 - config BINUTILS_USE_VERSION_2_42 bool "Binutils 2.42" select BINUTILS_VERSION_2_42 + + config BINUTILS_USE_VERSION_2_43 + bool "Binutils 2.43.1" + select BINUTILS_VERSION_2_43 + + config BINUTILS_USE_VERSION_2_44 + bool "Binutils 2.44" + select BINUTILS_VERSION_2_44 + + config BINUTILS_USE_VERSION_2_45 + bool "Binutils 2.45" + select BINUTILS_VERSION_2_45 endchoice config EXTRA_BINUTILS_CONFIG_OPTIONS diff --git a/toolchain/binutils/Config.version b/toolchain/binutils/Config.version index 81815ebed2..3464d130f9 100644 --- a/toolchain/binutils/Config.version +++ b/toolchain/binutils/Config.version @@ -1,28 +1,20 @@ -config BINUTILS_VERSION_2_37 - bool - -config BINUTILS_VERSION_2_38 - bool - -config BINUTILS_VERSION_2_39 +config BINUTILS_VERSION_2_42 bool -config BINUTILS_VERSION_2_40 +config BINUTILS_VERSION_2_43 bool -config BINUTILS_VERSION_2_41 +config BINUTILS_VERSION_2_44 + default y if !TOOLCHAINOPTS bool -config BINUTILS_VERSION_2_42 - default y if !TOOLCHAINOPTS +config BINUTILS_VERSION_2_45 bool config BINUTILS_VERSION string - default "2.37" if BINUTILS_VERSION_2_37 - default "2.38" if BINUTILS_VERSION_2_38 - default "2.39" if BINUTILS_VERSION_2_39 - default "2.40" if BINUTILS_VERSION_2_40 - default "2.41" if BINUTILS_VERSION_2_41 default "2.42" if BINUTILS_VERSION_2_42 + default "2.43.1" if BINUTILS_VERSION_2_43 + default "2.44" if BINUTILS_VERSION_2_44 + default "2.45" if BINUTILS_VERSION_2_45 diff --git a/toolchain/binutils/Makefile b/toolchain/binutils/Makefile index 8635e9710a..7077195e27 100644 --- a/toolchain/binutils/Makefile +++ b/toolchain/binutils/Makefile @@ -16,28 +16,20 @@ PKG_CPE_ID:=cpe:/a:gnu:binutils TAR_OPTIONS += --exclude='*.rej' -ifeq ($(PKG_VERSION),2.37) - PKG_HASH:=820d9724f020a3e69cb337893a0b63c2db161dadcb0e06fc11dc29eb1e84a32c -endif - -ifeq ($(PKG_VERSION),2.38) - PKG_HASH:=e316477a914f567eccc34d5d29785b8b0f5a10208d36bbacedcc39048ecfe024 -endif - -ifeq ($(PKG_VERSION),2.39) - PKG_HASH:=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00 +ifeq ($(PKG_VERSION),2.42) + PKG_HASH:=f6e4d41fd5fc778b06b7891457b3620da5ecea1006c6a4a41ae998109f85a800 endif -ifeq ($(PKG_VERSION),2.40) - PKG_HASH:=0f8a4c272d7f17f369ded10a4aca28b8e304828e95526da482b0ccc4dfc9d8e1 +ifeq ($(PKG_VERSION),2.43.1) + PKG_HASH:=13f74202a3c4c51118b797a39ea4200d3f6cfbe224da6d1d95bb938480132dfd endif -ifeq ($(PKG_VERSION),2.41) - PKG_HASH:=ae9a5789e23459e59606e6714723f2d3ffc31c03174191ef0d015bdf06007450 +ifeq ($(PKG_VERSION),2.44) + PKG_HASH:=ce2017e059d63e67ddb9240e9d4ec49c2893605035cd60e92ad53177f4377237 endif -ifeq ($(PKG_VERSION),2.42) - PKG_HASH:=f6e4d41fd5fc778b06b7891457b3620da5ecea1006c6a4a41ae998109f85a800 +ifeq ($(PKG_VERSION),2.45) + PKG_HASH:=c50c0e7f9cb188980e2cc97e4537626b1672441815587f1eab69d2a1bfbef5d2 endif HOST_BUILD_PARALLEL:=1 @@ -46,6 +38,9 @@ PATCH_DIR:=./patches/$(PKG_VERSION) include $(INCLUDE_DIR)/toolchain-build.mk +export ZSTD_CFLAGS=-I$(STAGING_DIR_HOST)/include -pthread +export ZSTD_LIBS=-L$(STAGING_DIR_HOST)/lib -lzstd -lpthread + ifdef CONFIG_GCC_USE_GRAPHITE GRAPHITE_CONFIGURE:= --with-isl=$(STAGING_DIR_HOST) else diff --git a/toolchain/binutils/patches/2.37/500-Change-default-emulation-for-mips64-linux.patch b/toolchain/binutils/patches/2.37/500-Change-default-emulation-for-mips64-linux.patch deleted file mode 100644 index c59843766e..0000000000 --- a/toolchain/binutils/patches/2.37/500-Change-default-emulation-for-mips64-linux.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- a/bfd/config.bfd -+++ b/bfd/config.bfd -@@ -891,12 +891,12 @@ case "${targ}" in - targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_be_vec mips_ecoff_le_vec" - ;; - mips64*el-*-linux*) -- targ_defvec=mips_elf32_ntrad_le_vec -- targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec" -+ targ_defvec=mips_elf64_trad_le_vec -+ targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_be_vec" - ;; - mips64*-*-linux*) -- targ_defvec=mips_elf32_ntrad_be_vec -- targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec" -+ targ_defvec=mips_elf64_trad_be_vec -+ targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_le_vec" - ;; - mips*el-*-linux*) - targ_defvec=mips_elf32_trad_le_vec ---- a/ld/configure.tgt -+++ b/ld/configure.tgt -@@ -530,12 +530,12 @@ mips*-*-vxworks*) targ_emul=elf32ebmipvx - ;; - mips*-*-windiss) targ_emul=elf32mipswindiss - ;; --mips64*el-*-linux-*) targ_emul=elf32ltsmipn32 -- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip" -+mips64*el-*-linux-*) targ_emul=elf64ltsmip -+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32ltsmip elf32btsmip elf64btsmip" - targ_extra_libpath=$targ_extra_emuls - ;; --mips64*-*-linux-*) targ_emul=elf32btsmipn32 -- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip" -+mips64*-*-linux-*) targ_emul=elf64btsmip -+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip" - targ_extra_libpath=$targ_extra_emuls - ;; - mips*el-*-linux-*) targ_emul=elf32ltsmip diff --git a/toolchain/binutils/patches/2.37/600-Close_the_file_descriptor.patch b/toolchain/binutils/patches/2.37/600-Close_the_file_descriptor.patch deleted file mode 100644 index fef86a9cb5..0000000000 --- a/toolchain/binutils/patches/2.37/600-Close_the_file_descriptor.patch +++ /dev/null @@ -1,184 +0,0 @@ -From: H.J. Lu <hjl.tools@gmail.com> -Date: Mon, 26 Jul 2021 12:59:55 +0000 (-0700) -Subject: bfd: Close the file descriptor if there is no archive fd -X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=1c611b40e6bfc8029bff7696814330b5bc0ee5c0 - -bfd: Close the file descriptor if there is no archive fd - -Close the file descriptor if there is no archive plugin file descriptor -to avoid running out of file descriptors on thin archives with many -archive members. - -bfd/ - - PR ld/28138 - * plugin.c (bfd_plugin_close_file_descriptor): Close the file - descriptor there is no archive plugin file descriptor. - -ld/ - - PR ld/28138 - * testsuite/ld-plugin/lto.exp: Run tmpdir/pr28138 only for - native build. - - PR ld/28138 - * testsuite/ld-plugin/lto.exp: Run ld/28138 tests. - * testsuite/ld-plugin/pr28138.c: New file. - * testsuite/ld-plugin/pr28138-1.c: Likewise. - * testsuite/ld-plugin/pr28138-2.c: Likewise. - * testsuite/ld-plugin/pr28138-3.c: Likewise. - * testsuite/ld-plugin/pr28138-4.c: Likewise. - * testsuite/ld-plugin/pr28138-5.c: Likewise. - * testsuite/ld-plugin/pr28138-6.c: Likewise. - * testsuite/ld-plugin/pr28138-7.c: Likewise. - -(cherry picked from commit 5a98fb7513b559e20dfebdbaa2a471afda3b4742) -(cherry picked from commit 7dc37e1e1209c80e0bab784df6b6bac335e836f2) ---- - ---- a/bfd/plugin.c -+++ b/bfd/plugin.c -@@ -291,6 +291,14 @@ bfd_plugin_close_file_descriptor (bfd *a - && !bfd_is_thin_archive (abfd->my_archive)) - abfd = abfd->my_archive; - -+ /* Close the file descriptor if there is no archive plugin file -+ descriptor. */ -+ if (abfd->archive_plugin_fd == -1) -+ { -+ close (fd); -+ return; -+ } -+ - abfd->archive_plugin_fd_open_count--; - /* Dup the archive plugin file descriptor for later use, which - will be closed by _bfd_archive_close_and_cleanup. */ ---- a/ld/testsuite/ld-plugin/lto.exp -+++ b/ld/testsuite/ld-plugin/lto.exp -@@ -687,6 +687,40 @@ if { [is_elf_format] && [check_lto_share - } - } - -+run_cc_link_tests [list \ -+ [list \ -+ "Build pr28138.a" \ -+ "-T" "" \ -+ {pr28138-1.c pr28138-2.c pr28138-3.c pr28138-4.c pr28138-5.c \ -+ pr28138-6.c pr28138-7.c} {} "pr28138.a" \ -+ ] \ -+ [list \ -+ "Build pr28138.o" \ -+ "" "" \ -+ {pr28138.c} {} \ -+ ] \ -+] -+ -+set exec_output [run_host_cmd "sh" \ -+ "-c \"ulimit -n 20; \ -+ $CC -Btmpdir/ld -o tmpdir/pr28138 \ -+ tmpdir/pr28138.o tmpdir/pr28138.a\""] -+set exec_output [prune_warnings $exec_output] -+if [string match "" $exec_output] then { -+ if { [isnative] } { -+ set exec_output [run_host_cmd "tmpdir/pr28138" ""] -+ if [string match "PASS" $exec_output] then { -+ pass "PR ld/28138" -+ } else { -+ fail "PR ld/28138" -+ } -+ } else { -+ pass "PR ld/28138" -+ } -+} else { -+ fail "PR ld/28138" -+} -+ - set testname "Build liblto-11.a" - remote_file host delete "tmpdir/liblto-11.a" - set catch_output [run_host_cmd "$ar" "rc $plug_opt tmpdir/liblto-11.a tmpdir/lto-11a.o tmpdir/lto-11b.o tmpdir/lto-11c.o"] ---- /dev/null -+++ b/ld/testsuite/ld-plugin/pr28138-1.c -@@ -0,0 +1,6 @@ -+extern int a0(void); -+int -+a1(void) -+{ -+ return 1 + a0(); -+} ---- /dev/null -+++ b/ld/testsuite/ld-plugin/pr28138-2.c -@@ -0,0 +1,6 @@ -+extern int a1(void); -+int -+a2(void) -+{ -+ return 1 + a1(); -+} ---- /dev/null -+++ b/ld/testsuite/ld-plugin/pr28138-3.c -@@ -0,0 +1,6 @@ -+extern int a2(void); -+int -+a3(void) -+{ -+ return 1 + a2(); -+} ---- /dev/null -+++ b/ld/testsuite/ld-plugin/pr28138-4.c -@@ -0,0 +1,6 @@ -+extern int a3(void); -+int -+a4(void) -+{ -+ return 1 + a3(); -+} ---- /dev/null -+++ b/ld/testsuite/ld-plugin/pr28138-5.c -@@ -0,0 +1,6 @@ -+extern int a4(void); -+int -+a5(void) -+{ -+ return 1 + a4(); -+} ---- /dev/null -+++ b/ld/testsuite/ld-plugin/pr28138-6.c -@@ -0,0 +1,6 @@ -+extern int a5(void); -+int -+a6(void) -+{ -+ return 1 + a5(); -+} ---- /dev/null -+++ b/ld/testsuite/ld-plugin/pr28138-7.c -@@ -0,0 +1,6 @@ -+extern int a6(void); -+int -+a7(void) -+{ -+ return 1 + a6(); -+} ---- /dev/null -+++ b/ld/testsuite/ld-plugin/pr28138.c -@@ -0,0 +1,20 @@ -+#include <stdio.h> -+ -+extern int a7(void); -+ -+int -+a0(void) -+{ -+ return 0; -+} -+ -+int -+main() -+{ -+ if (a7() == 7) -+ { -+ printf ("PASS\n"); -+ return 0; -+ } -+ return 1; -+} diff --git a/toolchain/binutils/patches/2.38/001-PR-30569-always-call-elf_backend_size_dynamic_sectio.patch b/toolchain/binutils/patches/2.38/001-PR-30569-always-call-elf_backend_size_dynamic_sectio.patch deleted file mode 100644 index 94488c3290..0000000000 --- a/toolchain/binutils/patches/2.38/001-PR-30569-always-call-elf_backend_size_dynamic_sectio.patch +++ /dev/null @@ -1,2172 +0,0 @@ -From af969b14aedcc0ae27dcefab4327ff2d153dec8b Mon Sep 17 00:00:00 2001 -From: Alan Modra <amodra@gmail.com> -Date: Thu, 28 Mar 2024 19:25:42 +1030 -Subject: [PATCH 1/2] PR 30569, always call elf_backend_size_dynamic_sections - -This largely mechanical patch is preparation for a followup patch. - -For quite some time I've thought that it would be useful to call -elf_backend_size_dynamic_sections even when no dynamic objects are -seen by the linker. That's what this patch does, with some renaming. -There are no functional changes to the linker, just a move of the -dynobj test in bfd_elf_size_dynamic_sections to target backend -functions, replacing the asserts/aborts already there. No doubt some -of the current always_size_sections functions could be moved to -size_dynamic_sections but I haven't made that change. - -Because both hooks are now always called, I have renamed -always_size_sections to early_size_sections and size_dynamic_sections -to late_size_sections. I condisdered calling late_size_sections plain -size_sections, since this is the usual target dynamic section sizing -hook, but decided that searching the sources for "size_sections" would -then hit early_size_sections and other functions. ---- - bfd/elf-bfd.h | 35 +++++++++++++++++------------------ - bfd/elf-m10300.c | 11 ++++++----- - bfd/elf32-arc.c | 9 +++++---- - bfd/elf32-arm.c | 15 ++++++++------- - bfd/elf32-bfin.c | 31 ++++++++++++++++--------------- - bfd/elf32-cr16.c | 11 ++++++----- - bfd/elf32-cris.c | 13 +++++++------ - bfd/elf32-csky.c | 8 ++++---- - bfd/elf32-frv.c | 23 ++++++++++++----------- - bfd/elf32-hppa.c | 8 ++++---- - bfd/elf32-i386.c | 7 +++---- - bfd/elf32-lm32.c | 15 ++++++++------- - bfd/elf32-m32c.c | 8 ++++---- - bfd/elf32-m32r.c | 11 ++++++----- - bfd/elf32-m68k.c | 16 ++++++++-------- - bfd/elf32-metag.c | 8 ++++---- - bfd/elf32-microblaze.c | 9 +++++---- - bfd/elf32-mips.c | 6 ++---- - bfd/elf32-nds32.c | 9 +++++---- - bfd/elf32-nios2.c | 15 ++++++++------- - bfd/elf32-or1k.c | 9 +++++---- - bfd/elf32-ppc.c | 11 ++++++----- - bfd/elf32-rl78.c | 8 ++++---- - bfd/elf32-s390.c | 10 +++++----- - bfd/elf32-score.c | 35 ++++++++++++++++++----------------- - bfd/elf32-score.h | 4 ++-- - bfd/elf32-score7.c | 13 +++++++------ - bfd/elf32-sh.c | 15 +++++++-------- - bfd/elf32-sparc.c | 3 +-- - bfd/elf32-tic6x.c | 14 +++++++------- - bfd/elf32-tilegx.c | 2 +- - bfd/elf32-tilepro.c | 11 +++++------ - bfd/elf32-vax.c | 16 +++++++--------- - bfd/elf32-xstormy16.c | 8 ++++---- - bfd/elf32-xtensa.c | 13 ++++++------- - bfd/elf64-alpha.c | 19 ++++++++++--------- - bfd/elf64-hppa.c | 11 ++++------- - bfd/elf64-ia64-vms.c | 13 +++++++------ - bfd/elf64-mips.c | 8 ++++---- - bfd/elf64-ppc.c | 12 ++++++------ - bfd/elf64-s390.c | 10 +++++----- - bfd/elf64-sparc.c | 4 ++-- - bfd/elf64-tilegx.c | 2 +- - bfd/elf64-x86-64.c | 7 +++---- - bfd/elflink.c | 9 ++++----- - bfd/elfn32-mips.c | 6 ++---- - bfd/elfnn-aarch64.c | 21 +++++++++++---------- - bfd/elfnn-ia64.c | 11 ++++++----- - bfd/elfnn-kvx.c | 19 +++++++++---------- - bfd/elfnn-loongarch.c | 9 +++++---- - bfd/elfnn-riscv.c | 7 ++++--- - bfd/elfxx-mips.c | 15 ++++++++------- - bfd/elfxx-mips.h | 4 ++-- - bfd/elfxx-sparc.c | 7 ++++--- - bfd/elfxx-sparc.h | 2 +- - bfd/elfxx-target.h | 12 ++++++------ - bfd/elfxx-tilegx.c | 7 ++++--- - bfd/elfxx-tilegx.h | 2 +- - bfd/elfxx-x86.c | 8 ++++---- - bfd/elfxx-x86.h | 8 ++++---- - ld/emultempl/vms.em | 7 +++---- - 61 files changed, 343 insertions(+), 337 deletions(-) - ---- a/bfd/elf-bfd.h -+++ b/bfd/elf-bfd.h -@@ -1135,7 +1135,7 @@ struct elf_backend_data - /* The ADJUST_DYNAMIC_SYMBOL function is called by the ELF backend - linker for every symbol which is defined by a dynamic object and - referenced by a regular object. This is called after all the -- input files have been seen, but before the SIZE_DYNAMIC_SECTIONS -+ input files have been seen, but before the LATE_SIZE_SECTIONS - function has been called. The hash table entry should be - bfd_link_hash_defined ore bfd_link_hash_defweak, and it should be - defined in a section from a dynamic object. Dynamic object -@@ -1147,24 +1147,23 @@ struct elf_backend_data - bool (*elf_backend_adjust_dynamic_symbol) - (struct bfd_link_info *info, struct elf_link_hash_entry *h); - -- /* The ALWAYS_SIZE_SECTIONS function is called by the backend linker -- after all the linker input files have been seen but before the -- section sizes have been set. This is called after -- ADJUST_DYNAMIC_SYMBOL, but before SIZE_DYNAMIC_SECTIONS. */ -- bool (*elf_backend_always_size_sections) -+ /* The EARLY_SIZE_SECTIONS and LATE_SIZE_SECTIONS functions are -+ called by the backend linker after all linker input files have -+ been seen and sections have been assigned to output sections, but -+ before the section sizes have been set. Both of these functions -+ are called even when no dynamic object is seen by the linker. -+ Between them, they must set the sizes of the dynamic sections and -+ other backend specific sections, and may fill in their contents. -+ Most backends need only use LATE_SIZE_SECTIONS. -+ EARLY_SIZE_SECTIONS is called before --export-dynamic makes some -+ symbols dynamic and before ADJUST_DYNAMIC_SYMBOL processes -+ dynamic symbols, LATE_SIZE_SECTIONS afterwards. The generic ELF -+ linker can handle the .dynsym, .dynstr and .hash sections. -+ Besides those, these functions must handle the .interp section -+ and any other sections created by CREATE_DYNAMIC_SECTIONS. */ -+ bool (*elf_backend_early_size_sections) - (bfd *output_bfd, struct bfd_link_info *info); -- -- /* The SIZE_DYNAMIC_SECTIONS function is called by the ELF backend -- linker after all the linker input files have been seen but before -- the sections sizes have been set. This is called after -- ADJUST_DYNAMIC_SYMBOL has been called on all appropriate symbols. -- It is only called when linking against a dynamic object. It must -- set the sizes of the dynamic sections, and may fill in their -- contents as well. The generic ELF linker can handle the .dynsym, -- .dynstr and .hash sections. This function must handle the -- .interp section and any sections created by the -- CREATE_DYNAMIC_SECTIONS entry point. */ -- bool (*elf_backend_size_dynamic_sections) -+ bool (*elf_backend_late_size_sections) - (bfd *output_bfd, struct bfd_link_info *info); - - /* The STRIP_ZERO_SIZED_DYNAMIC_SECTIONS function is called by the ---- a/bfd/elf-m10300.c -+++ b/bfd/elf-m10300.c -@@ -5003,8 +5003,8 @@ _bfd_mn10300_elf_adjust_dynamic_symbol ( - /* Set the sizes of the dynamic sections. */ - - static bool --_bfd_mn10300_elf_size_dynamic_sections (bfd * output_bfd, -- struct bfd_link_info * info) -+_bfd_mn10300_elf_late_size_sections (bfd * output_bfd, -+ struct bfd_link_info * info) - { - struct elf32_mn10300_link_hash_table *htab = elf32_mn10300_hash_table (info); - bfd * dynobj; -@@ -5012,7 +5012,8 @@ _bfd_mn10300_elf_size_dynamic_sections ( - bool relocs; - - dynobj = htab->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -5499,8 +5500,8 @@ mn10300_elf_mkobject (bfd *abfd) - _bfd_mn10300_elf_create_dynamic_sections - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mn10300_elf_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections \ -- _bfd_mn10300_elf_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ _bfd_mn10300_elf_late_size_sections - #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all - #define elf_backend_finish_dynamic_symbol \ - _bfd_mn10300_elf_finish_dynamic_symbol ---- a/bfd/elf32-arc.c -+++ b/bfd/elf32-arc.c -@@ -2702,8 +2702,8 @@ elf_arc_finish_dynamic_sections (bfd * o - - /* Set the sizes of the dynamic sections. */ - static bool --elf_arc_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_arc_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; -@@ -2711,7 +2711,8 @@ elf_arc_size_dynamic_sections (bfd *outp - struct elf_link_hash_table *htab = elf_hash_table (info); - - dynobj = htab->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->dynamic_sections_created) - { -@@ -3126,7 +3127,7 @@ arc_elf_relax_section (bfd *abfd, asecti - #define elf_backend_finish_dynamic_symbol elf_arc_finish_dynamic_symbol - - #define elf_backend_finish_dynamic_sections elf_arc_finish_dynamic_sections --#define elf_backend_size_dynamic_sections elf_arc_size_dynamic_sections -+#define elf_backend_late_size_sections elf_arc_late_size_sections - - #define elf_backend_can_gc_sections 1 - #define elf_backend_want_got_plt 1 ---- a/bfd/elf32-arm.c -+++ b/bfd/elf32-arm.c -@@ -16709,8 +16709,8 @@ bfd_elf32_arm_set_byteswap_code (struct - /* Set the sizes of the dynamic sections. */ - - static bool --elf32_arm_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info * info) -+elf32_arm_late_size_sections (bfd * output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info * info) - { - bfd * dynobj; - asection * s; -@@ -16723,7 +16723,9 @@ elf32_arm_size_dynamic_sections (bfd * o - return false; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; -+ - check_use_blx (htab); - - if (elf_hash_table (info)->dynamic_sections_created) -@@ -17095,8 +17097,7 @@ elf32_arm_size_dynamic_sections (bfd * o - _TLS_MODULE_BASE_, if needed. */ - - static bool --elf32_arm_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf32_arm_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - asection *tls_sec; - struct elf32_arm_link_hash_table *htab; -@@ -20263,8 +20264,8 @@ elf32_arm_backend_symbol_processing (bfd - #define elf_backend_create_dynamic_sections elf32_arm_create_dynamic_sections - #define elf_backend_finish_dynamic_symbol elf32_arm_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections elf32_arm_finish_dynamic_sections --#define elf_backend_size_dynamic_sections elf32_arm_size_dynamic_sections --#define elf_backend_always_size_sections elf32_arm_always_size_sections -+#define elf_backend_late_size_sections elf32_arm_late_size_sections -+#define elf_backend_early_size_sections elf32_arm_early_size_sections - #define elf_backend_init_index_section _bfd_elf_init_2_index_sections - #define elf_backend_init_file_header elf32_arm_init_file_header - #define elf_backend_reloc_type_class elf32_arm_reloc_type_class ---- a/bfd/elf32-bfin.c -+++ b/bfd/elf32-bfin.c -@@ -4031,8 +4031,8 @@ _bfinfdpic_size_got_plt (bfd *output_bfd - /* Set the sizes of the dynamic sections. */ - - static bool --elf32_bfinfdpic_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf32_bfinfdpic_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - struct elf_link_hash_table *htab; - bfd *dynobj; -@@ -4041,7 +4041,8 @@ elf32_bfinfdpic_size_dynamic_sections (b - - htab = elf_hash_table (info); - dynobj = htab->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->dynamic_sections_created) - { -@@ -4090,7 +4091,7 @@ elf32_bfinfdpic_size_dynamic_sections (b - } - - static bool --elf32_bfinfdpic_always_size_sections (bfd *output_bfd, -+elf32_bfinfdpic_early_size_sections (bfd *output_bfd, - struct bfd_link_info *info) - { - if (!bfd_link_relocatable (info) -@@ -5128,15 +5129,16 @@ bfin_discard_copies (struct elf_link_has - } - - static bool --bfin_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+bfin_late_size_sections (bfd * output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; - bool relocs; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -5428,8 +5430,7 @@ struct bfd_elf_special_section const elf - #define elf_backend_check_relocs bfin_check_relocs - #define elf_backend_adjust_dynamic_symbol \ - bfin_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections \ -- bfin_size_dynamic_sections -+#define elf_backend_late_size_sections bfin_late_size_sections - #define elf_backend_relocate_section bfin_relocate_section - #define elf_backend_finish_dynamic_symbol \ - bfin_finish_dynamic_symbol -@@ -5475,9 +5476,9 @@ struct bfd_elf_special_section const elf - #undef bfd_elf32_bfd_link_hash_table_create - #define bfd_elf32_bfd_link_hash_table_create \ - bfinfdpic_elf_link_hash_table_create --#undef elf_backend_always_size_sections --#define elf_backend_always_size_sections \ -- elf32_bfinfdpic_always_size_sections -+#undef elf_backend_early_size_sections -+#define elf_backend_early_size_sections \ -+ elf32_bfinfdpic_early_size_sections - - #undef elf_backend_create_dynamic_sections - #define elf_backend_create_dynamic_sections \ -@@ -5485,9 +5486,9 @@ struct bfd_elf_special_section const elf - #undef elf_backend_adjust_dynamic_symbol - #define elf_backend_adjust_dynamic_symbol \ - elf32_bfinfdpic_adjust_dynamic_symbol --#undef elf_backend_size_dynamic_sections --#define elf_backend_size_dynamic_sections \ -- elf32_bfinfdpic_size_dynamic_sections -+#undef elf_backend_late_size_sections -+#define elf_backend_late_size_sections \ -+ elf32_bfinfdpic_late_size_sections - #undef elf_backend_finish_dynamic_symbol - #define elf_backend_finish_dynamic_symbol \ - elf32_bfinfdpic_finish_dynamic_symbol ---- a/bfd/elf32-cr16.c -+++ b/bfd/elf32-cr16.c -@@ -2381,15 +2381,16 @@ _bfd_cr16_elf_adjust_dynamic_symbol (str - /* Set the sizes of the dynamic sections. */ - - static bool --_bfd_cr16_elf_size_dynamic_sections (bfd * output_bfd, -- struct bfd_link_info * info) -+_bfd_cr16_elf_late_size_sections (bfd * output_bfd, -+ struct bfd_link_info * info) - { - bfd * dynobj; - asection * s; - bool relocs; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -2826,8 +2827,8 @@ _bfd_cr16_elf_reloc_type_class (const st - _bfd_cr16_elf_create_dynamic_sections - #define elf_backend_adjust_dynamic_symbol \ - _bfd_cr16_elf_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections \ -- _bfd_cr16_elf_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ _bfd_cr16_elf_late_size_sections - #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all - #define elf_backend_finish_dynamic_symbol \ - _bfd_cr16_elf_finish_dynamic_symbol ---- a/bfd/elf32-cris.c -+++ b/bfd/elf32-cris.c -@@ -2527,7 +2527,7 @@ cris_elf_plt_sym_val (bfd_vma i ATTRIBUT - entry but we found we will not create any. Called when we find we will - not have any PLT for this symbol, by for example - elf_cris_adjust_dynamic_symbol when we're doing a proper dynamic link, -- or elf_cris_size_dynamic_sections if no dynamic sections will be -+ or elf_cris_late_size_sections if no dynamic sections will be - created (we're only linking static objects). */ - - static bool -@@ -3508,8 +3508,8 @@ cris_elf_check_relocs (bfd *abfd, - /* Set the sizes of the dynamic sections. */ - - static bool --elf_cris_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_cris_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_cris_link_hash_table * htab; - bfd *dynobj; -@@ -3521,7 +3521,8 @@ elf_cris_size_dynamic_sections (bfd *out - return false; - - dynobj = htab->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->root.dynamic_sections_created) - { -@@ -4090,8 +4091,8 @@ elf_cris_got_elt_size (bfd *abfd ATTRIBU - elf_cris_adjust_dynamic_symbol - #define elf_backend_copy_indirect_symbol \ - elf_cris_copy_indirect_symbol --#define elf_backend_size_dynamic_sections \ -- elf_cris_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ elf_cris_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_finish_dynamic_symbol \ - elf_cris_finish_dynamic_symbol ---- a/bfd/elf32-csky.c -+++ b/bfd/elf32-csky.c -@@ -1893,8 +1893,8 @@ csky_allocate_dynrelocs (struct elf_link - /* Set the sizes of the dynamic sections. */ - - static bool --csky_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+csky_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct csky_elf_link_hash_table *htab; - bfd *dynobj; -@@ -1907,7 +1907,7 @@ csky_elf_size_dynamic_sections (bfd *out - return false; - dynobj = htab->elf.dynobj; - if (dynobj == NULL) -- return false; -+ return true; - - if (htab->elf.dynamic_sections_created) - { -@@ -5344,7 +5344,7 @@ elf32_csky_obj_attrs_handle_unknown (bfd - /* Dynamic relocate related API. */ - #define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections - #define elf_backend_adjust_dynamic_symbol csky_elf_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections csky_elf_size_dynamic_sections -+#define elf_backend_late_size_sections csky_elf_late_size_sections - #define elf_backend_finish_dynamic_symbol csky_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections csky_elf_finish_dynamic_sections - #define elf_backend_rela_normal 1 ---- a/bfd/elf32-frv.c -+++ b/bfd/elf32-frv.c -@@ -5423,15 +5423,16 @@ _frvfdpic_size_got_plt (bfd *output_bfd, - /* Set the sizes of the dynamic sections. */ - - static bool --elf32_frvfdpic_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf32_frvfdpic_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; - struct _frvfdpic_dynamic_got_plt_info gpinfo; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -5472,8 +5473,8 @@ elf32_frvfdpic_size_dynamic_sections (bf - } - - static bool --elf32_frvfdpic_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf32_frvfdpic_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - if (!bfd_link_relocatable (info) - && !bfd_elf_stack_segment_size (output_bfd, info, -@@ -6817,9 +6818,9 @@ elf32_frv_grok_psinfo (bfd *abfd, Elf_In - #undef bfd_elf32_bfd_link_hash_table_create - #define bfd_elf32_bfd_link_hash_table_create \ - frvfdpic_elf_link_hash_table_create --#undef elf_backend_always_size_sections --#define elf_backend_always_size_sections \ -- elf32_frvfdpic_always_size_sections -+#undef elf_backend_early_size_sections -+#define elf_backend_early_size_sections \ -+ elf32_frvfdpic_early_size_sections - - #undef elf_backend_create_dynamic_sections - #define elf_backend_create_dynamic_sections \ -@@ -6827,9 +6828,9 @@ elf32_frv_grok_psinfo (bfd *abfd, Elf_In - #undef elf_backend_adjust_dynamic_symbol - #define elf_backend_adjust_dynamic_symbol \ - elf32_frvfdpic_adjust_dynamic_symbol --#undef elf_backend_size_dynamic_sections --#define elf_backend_size_dynamic_sections \ -- elf32_frvfdpic_size_dynamic_sections -+#undef elf_backend_late_size_sections -+#define elf_backend_late_size_sections \ -+ elf32_frvfdpic_late_size_sections - #undef bfd_elf32_bfd_relax_section - #define bfd_elf32_bfd_relax_section \ - elf32_frvfdpic_relax_section ---- a/bfd/elf32-hppa.c -+++ b/bfd/elf32-hppa.c -@@ -2042,8 +2042,8 @@ clobber_millicode_symbols (struct elf_li - /* Set the sizes of the dynamic sections. */ - - static bool --elf32_hppa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf32_hppa_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf32_hppa_link_hash_table *htab; - bfd *dynobj; -@@ -2057,7 +2057,7 @@ elf32_hppa_size_dynamic_sections (bfd *o - - dynobj = htab->etab.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - if (htab->etab.dynamic_sections_created) - { -@@ -4450,7 +4450,7 @@ elf32_hppa_elf_get_symbol_type (Elf_Inte - #define elf_backend_hide_symbol elf32_hppa_hide_symbol - #define elf_backend_finish_dynamic_symbol elf32_hppa_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections elf32_hppa_finish_dynamic_sections --#define elf_backend_size_dynamic_sections elf32_hppa_size_dynamic_sections -+#define elf_backend_late_size_sections elf32_hppa_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_gc_mark_hook elf32_hppa_gc_mark_hook - #define elf_backend_grok_prstatus elf32_hppa_grok_prstatus ---- a/bfd/elf32-i386.c -+++ b/bfd/elf32-i386.c -@@ -1905,8 +1905,7 @@ elf_i386_scan_relocs (bfd *abfd, - } - - static bool --elf_i386_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf_i386_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - bfd *abfd; - -@@ -1919,7 +1918,7 @@ elf_i386_always_size_sections (bfd *outp - elf_i386_scan_relocs)) - return false; - -- return _bfd_x86_elf_always_size_sections (output_bfd, info); -+ return _bfd_x86_elf_early_size_sections (output_bfd, info); - } - - /* Set the correct type for an x86 ELF section. We do this by the -@@ -4412,7 +4411,7 @@ elf_i386_link_setup_gnu_properties (stru - #define bfd_elf32_get_synthetic_symtab elf_i386_get_synthetic_symtab - - #define elf_backend_relocs_compatible _bfd_elf_relocs_compatible --#define elf_backend_always_size_sections elf_i386_always_size_sections -+#define elf_backend_early_size_sections elf_i386_early_size_sections - #define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections - #define elf_backend_fake_sections elf_i386_fake_sections - #define elf_backend_finish_dynamic_sections elf_i386_finish_dynamic_sections ---- a/bfd/elf32-lm32.c -+++ b/bfd/elf32-lm32.c -@@ -1906,8 +1906,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --lm32_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+lm32_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - struct elf_lm32_link_hash_table *htab; - bfd *dynobj; -@@ -1920,7 +1920,8 @@ lm32_elf_size_dynamic_sections (bfd *out - return false; - - dynobj = htab->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->root.dynamic_sections_created) - { -@@ -2309,7 +2310,7 @@ lm32_elf_create_dynamic_sections (bfd *a - } - - static bool --lm32_elf_always_size_sections (bfd *output_bfd, struct bfd_link_info *info) -+lm32_elf_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - if (!bfd_link_relocatable (info)) - { -@@ -2395,7 +2396,7 @@ lm32_elf_fdpic_copy_private_bfd_data (bf - #define bfd_elf32_bfd_link_hash_table_create lm32_elf_link_hash_table_create - #define elf_backend_check_relocs lm32_elf_check_relocs - #define elf_backend_reloc_type_class lm32_elf_reloc_type_class --#define elf_backend_size_dynamic_sections lm32_elf_size_dynamic_sections -+#define elf_backend_late_size_sections lm32_elf_late_size_sections - #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all - #define elf_backend_create_dynamic_sections lm32_elf_create_dynamic_sections - #define elf_backend_finish_dynamic_sections lm32_elf_finish_dynamic_sections -@@ -2416,8 +2417,8 @@ lm32_elf_fdpic_copy_private_bfd_data (bf - #undef elf32_bed - #define elf32_bed elf32_lm32fdpic_bed - --#undef elf_backend_always_size_sections --#define elf_backend_always_size_sections lm32_elf_always_size_sections -+#undef elf_backend_early_size_sections -+#define elf_backend_early_size_sections lm32_elf_early_size_sections - #undef bfd_elf32_bfd_copy_private_bfd_data - #define bfd_elf32_bfd_copy_private_bfd_data lm32_elf_fdpic_copy_private_bfd_data - ---- a/bfd/elf32-m32c.c -+++ b/bfd/elf32-m32c.c -@@ -773,8 +773,8 @@ m32c_elf_finish_dynamic_sections (bfd *a - } - - static bool --m32c_elf_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+m32c_elf_early_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *splt; -@@ -2131,8 +2131,8 @@ _bfd_m32c_elf_eh_frame_address_size (bfd - #define elf_backend_check_relocs m32c_elf_check_relocs - #define elf_backend_object_p m32c_elf_object_p - #define elf_symbol_leading_char ('_') --#define elf_backend_always_size_sections \ -- m32c_elf_always_size_sections -+#define elf_backend_early_size_sections \ -+ m32c_elf_early_size_sections - #define elf_backend_finish_dynamic_sections \ - m32c_elf_finish_dynamic_sections - ---- a/bfd/elf32-m32r.c -+++ b/bfd/elf32-m32r.c -@@ -1958,8 +1958,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --m32r_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+m32r_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_link_hash_table *htab; - bfd *dynobj; -@@ -1968,7 +1968,7 @@ m32r_elf_size_dynamic_sections (bfd *out - bfd *ibfd; - - #ifdef DEBUG_PIC -- printf ("m32r_elf_size_dynamic_sections()\n"); -+ printf ("m32r_elf_late_size_sections()\n"); - #endif - - htab = m32r_elf_hash_table (info); -@@ -1976,7 +1976,8 @@ m32r_elf_size_dynamic_sections (bfd *out - return false; - - dynobj = htab->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->dynamic_sections_created) - { -@@ -3658,7 +3659,7 @@ m32r_elf_reloc_type_class (const struct - - #define elf_backend_create_dynamic_sections m32r_elf_create_dynamic_sections - #define bfd_elf32_bfd_link_hash_table_create m32r_elf_link_hash_table_create --#define elf_backend_size_dynamic_sections m32r_elf_size_dynamic_sections -+#define elf_backend_late_size_sections m32r_elf_late_size_sections - #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all - #define elf_backend_finish_dynamic_sections m32r_elf_finish_dynamic_sections - #define elf_backend_adjust_dynamic_symbol m32r_elf_adjust_dynamic_symbol ---- a/bfd/elf32-m68k.c -+++ b/bfd/elf32-m68k.c -@@ -2934,7 +2934,7 @@ elf_m68k_get_plt_info (bfd *output_bfd) - It's a convenient place to determine the PLT style. */ - - static bool --elf_m68k_always_size_sections (bfd *output_bfd, struct bfd_link_info *info) -+elf_m68k_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - /* Bind input BFDs to GOTs and calculate sizes of .got and .rela.got - sections. */ -@@ -3107,15 +3107,16 @@ elf_m68k_adjust_dynamic_symbol (struct b - /* Set the sizes of the dynamic sections. */ - - static bool --elf_m68k_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_m68k_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; - bool relocs; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -4628,12 +4629,11 @@ elf_m68k_grok_psinfo (bfd *abfd, Elf_Int - #define bfd_elf32_bfd_final_link bfd_elf_final_link - - #define elf_backend_check_relocs elf_m68k_check_relocs --#define elf_backend_always_size_sections \ -- elf_m68k_always_size_sections -+#define elf_backend_early_size_sections \ -+ elf_m68k_early_size_sections - #define elf_backend_adjust_dynamic_symbol \ - elf_m68k_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections \ -- elf_m68k_size_dynamic_sections -+#define elf_backend_late_size_sections elf_m68k_late_size_sections - #define elf_backend_final_write_processing elf_m68k_final_write_processing - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section elf_m68k_relocate_section ---- a/bfd/elf32-metag.c -+++ b/bfd/elf32-metag.c -@@ -2717,8 +2717,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --elf_metag_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_metag_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_metag_link_hash_table *htab; - bfd *dynobj; -@@ -2729,7 +2729,7 @@ elf_metag_size_dynamic_sections (bfd *ou - htab = metag_link_hash_table (info); - dynobj = htab->etab.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - if (htab->etab.dynamic_sections_created) - { -@@ -4019,7 +4019,7 @@ elf_metag_plt_sym_val (bfd_vma i, const - #define elf_backend_adjust_dynamic_symbol elf_metag_adjust_dynamic_symbol - #define elf_backend_finish_dynamic_symbol elf_metag_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections elf_metag_finish_dynamic_sections --#define elf_backend_size_dynamic_sections elf_metag_size_dynamic_sections -+#define elf_backend_late_size_sections elf_metag_late_size_sections - #define elf_backend_omit_section_dynsym \ - _bfd_elf_omit_section_dynsym_all - #define elf_backend_init_file_header elf_metag_init_file_header ---- a/bfd/elf32-microblaze.c -+++ b/bfd/elf32-microblaze.c -@@ -2901,8 +2901,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --microblaze_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+microblaze_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf32_mb_link_hash_table *htab; - bfd *dynobj; -@@ -2914,7 +2914,8 @@ microblaze_elf_size_dynamic_sections (bf - return false; - - dynobj = htab->elf.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - /* Set up .got offsets for local syms, and space for local dynamic - relocs. */ -@@ -3431,7 +3432,7 @@ microblaze_elf_add_symbol_hook (bfd *abf - #define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections - #define elf_backend_finish_dynamic_sections microblaze_elf_finish_dynamic_sections - #define elf_backend_finish_dynamic_symbol microblaze_elf_finish_dynamic_symbol --#define elf_backend_size_dynamic_sections microblaze_elf_size_dynamic_sections -+#define elf_backend_late_size_sections microblaze_elf_late_size_sections - #define elf_backend_add_symbol_hook microblaze_elf_add_symbol_hook - - #include "elf32-target.h" ---- a/bfd/elf32-mips.c -+++ b/bfd/elf32-mips.c -@@ -2526,10 +2526,8 @@ static const struct ecoff_debug_swap mip - #define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mips_elf_adjust_dynamic_symbol --#define elf_backend_always_size_sections \ -- _bfd_mips_elf_always_size_sections --#define elf_backend_size_dynamic_sections \ -- _bfd_mips_elf_size_dynamic_sections -+#define elf_backend_early_size_sections _bfd_mips_elf_early_size_sections -+#define elf_backend_late_size_sections _bfd_mips_elf_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section _bfd_mips_elf_relocate_section - #define elf_backend_finish_dynamic_symbol \ ---- a/bfd/elf32-nds32.c -+++ b/bfd/elf32-nds32.c -@@ -4248,8 +4248,8 @@ elf32_nds32_add_dynreloc (bfd *output_bf - /* Set the sizes of the dynamic sections. */ - - static bool --nds32_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+nds32_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_nds32_link_hash_table *htab; - bfd *dynobj; -@@ -4262,7 +4262,8 @@ nds32_elf_size_dynamic_sections (bfd *ou - return false; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -13930,7 +13931,7 @@ nds32_elf_unify_tls_model (bfd *inbfd, a - #define elf_backend_create_dynamic_sections nds32_elf_create_dynamic_sections - #define elf_backend_finish_dynamic_sections nds32_elf_finish_dynamic_sections - #define elf_backend_finish_dynamic_symbol nds32_elf_finish_dynamic_symbol --#define elf_backend_size_dynamic_sections nds32_elf_size_dynamic_sections -+#define elf_backend_late_size_sections nds32_elf_late_size_sections - #define elf_backend_relocate_section nds32_elf_relocate_section - #define elf_backend_gc_mark_hook nds32_elf_gc_mark_hook - #define elf_backend_grok_prstatus nds32_elf_grok_prstatus ---- a/bfd/elf32-nios2.c -+++ b/bfd/elf32-nios2.c -@@ -5411,7 +5411,7 @@ nios2_elf32_adjust_dynamic_symbol (struc - return true; - } - --/* Worker function for nios2_elf32_size_dynamic_sections. */ -+/* Worker function for nios2_elf32_late_size_sections. */ - static bool - adjust_dynrelocs (struct elf_link_hash_entry *h, PTR inf) - { -@@ -5438,7 +5438,7 @@ adjust_dynrelocs (struct elf_link_hash_e - return true; - } - --/* Another worker function for nios2_elf32_size_dynamic_sections. -+/* Another worker function for nios2_elf32_late_size_sections. - Allocate space in .plt, .got and associated reloc sections for - dynamic relocs. */ - static bool -@@ -5673,11 +5673,11 @@ allocate_dynrelocs (struct elf_link_hash - return true; - } - --/* Implement elf_backend_size_dynamic_sections: -+/* Implement elf_backend_late_size_sections: - Set the sizes of the dynamic sections. */ - static bool --nios2_elf32_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+nios2_elf32_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; -@@ -5687,7 +5687,8 @@ nios2_elf32_size_dynamic_sections (bfd * - - htab = elf32_nios2_hash_table (info); - dynobj = htab->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - htab->res_n_size = 0; - if (htab->root.dynamic_sections_created) -@@ -6058,7 +6059,7 @@ const struct bfd_elf_special_section elf - nios2_elf32_finish_dynamic_sections - #define elf_backend_adjust_dynamic_symbol nios2_elf32_adjust_dynamic_symbol - #define elf_backend_reloc_type_class nios2_elf32_reloc_type_class --#define elf_backend_size_dynamic_sections nios2_elf32_size_dynamic_sections -+#define elf_backend_late_size_sections nios2_elf32_late_size_sections - #define elf_backend_add_symbol_hook nios2_elf_add_symbol_hook - #define elf_backend_copy_indirect_symbol nios2_elf32_copy_indirect_symbol - #define elf_backend_object_p nios2_elf32_object_p ---- a/bfd/elf32-or1k.c -+++ b/bfd/elf32-or1k.c -@@ -3023,8 +3023,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --or1k_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+or1k_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_or1k_link_hash_table *htab; - bfd *dynobj; -@@ -3037,7 +3037,8 @@ or1k_elf_size_dynamic_sections (bfd *out - return false; - - dynobj = htab->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->root.dynamic_sections_created) - { -@@ -3390,7 +3391,7 @@ or1k_grok_psinfo (bfd *abfd, Elf_Interna - #define elf_backend_copy_indirect_symbol or1k_elf_copy_indirect_symbol - #define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections - #define elf_backend_finish_dynamic_sections or1k_elf_finish_dynamic_sections --#define elf_backend_size_dynamic_sections or1k_elf_size_dynamic_sections -+#define elf_backend_late_size_sections or1k_elf_late_size_sections - #define elf_backend_adjust_dynamic_symbol or1k_elf_adjust_dynamic_symbol - #define elf_backend_finish_dynamic_symbol or1k_elf_finish_dynamic_symbol - ---- a/bfd/elf32-ppc.c -+++ b/bfd/elf32-ppc.c -@@ -5497,8 +5497,8 @@ static const unsigned char glink_eh_fram - /* Set the sizes of the dynamic sections. */ - - static bool --ppc_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+ppc_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - struct ppc_elf_link_hash_table *htab; - asection *s; -@@ -5506,11 +5506,12 @@ ppc_elf_size_dynamic_sections (bfd *outp - bfd *ibfd; - - #ifdef DEBUG -- fprintf (stderr, "ppc_elf_size_dynamic_sections called\n"); -+ fprintf (stderr, "ppc_elf_late_size_sections called\n"); - #endif - - htab = ppc_elf_hash_table (info); -- BFD_ASSERT (htab->elf.dynobj != NULL); -+ if (htab->elf.dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -10410,7 +10411,7 @@ ppc_elf_finish_dynamic_sections (bfd *ou - #define elf_backend_copy_indirect_symbol ppc_elf_copy_indirect_symbol - #define elf_backend_adjust_dynamic_symbol ppc_elf_adjust_dynamic_symbol - #define elf_backend_add_symbol_hook ppc_elf_add_symbol_hook --#define elf_backend_size_dynamic_sections ppc_elf_size_dynamic_sections -+#define elf_backend_late_size_sections ppc_elf_late_size_sections - #define elf_backend_hash_symbol ppc_elf_hash_symbol - #define elf_backend_finish_dynamic_symbol ppc_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections ppc_elf_finish_dynamic_sections ---- a/bfd/elf32-rl78.c -+++ b/bfd/elf32-rl78.c -@@ -1440,8 +1440,8 @@ rl78_elf_finish_dynamic_sections (bfd *a - } - - static bool --rl78_elf_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+rl78_elf_early_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *splt; -@@ -2609,8 +2609,8 @@ rl78_elf_relax_section (bfd *abfd, - - #define bfd_elf32_bfd_relax_section rl78_elf_relax_section - #define elf_backend_check_relocs rl78_elf_check_relocs --#define elf_backend_always_size_sections \ -- rl78_elf_always_size_sections -+#define elf_backend_early_size_sections \ -+ rl78_elf_early_size_sections - #define elf_backend_finish_dynamic_sections \ - rl78_elf_finish_dynamic_sections - ---- a/bfd/elf32-s390.c -+++ b/bfd/elf32-s390.c -@@ -1366,7 +1366,7 @@ elf_s390_gc_mark_hook (asection *sec, - entry but we found we will not create any. Called when we find we will - not have any PLT for this symbol, by for example - elf_s390_adjust_dynamic_symbol when we're doing a proper dynamic link, -- or elf_s390_size_dynamic_sections if no dynamic sections will be -+ or elf_s390_late_size_sections if no dynamic sections will be - created (we're only linking static objects). */ - - static void -@@ -1778,8 +1778,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --elf_s390_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_s390_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_s390_link_hash_table *htab; - bfd *dynobj; -@@ -1790,7 +1790,7 @@ elf_s390_size_dynamic_sections (bfd *out - htab = elf_s390_hash_table (info); - dynobj = htab->elf.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - if (htab->elf.dynamic_sections_created) - { -@@ -3926,7 +3926,7 @@ elf32_s390_merge_private_bfd_data (bfd * - #define elf_backend_gc_mark_hook elf_s390_gc_mark_hook - #define elf_backend_reloc_type_class elf_s390_reloc_type_class - #define elf_backend_relocate_section elf_s390_relocate_section --#define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections -+#define elf_backend_late_size_sections elf_s390_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_grok_prstatus elf_s390_grok_prstatus - #define elf_backend_grok_psinfo elf_s390_grok_psinfo ---- a/bfd/elf32-score.c -+++ b/bfd/elf32-score.c -@@ -1089,7 +1089,7 @@ score_elf_got_info (bfd *abfd, asection - appear towards the end. This reduces the amount of GOT space - required. MAX_LOCAL is used to set the number of local symbols - known to be in the dynamic symbol table. During -- s3_bfd_score_elf_size_dynamic_sections, this value is 1. Afterward, the -+ s3_bfd_score_elf_late_size_sections, this value is 1. Afterward, the - section symbols are added and the count is higher. */ - static bool - score_elf_sort_hash_table (struct bfd_link_info *info, -@@ -3160,8 +3160,8 @@ s3_bfd_score_elf_adjust_dynamic_symbol ( - /* This function is called after all the input files have been read, - and the input sections have been assigned to output sections. */ - static bool --s3_bfd_score_elf_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+s3_bfd_score_elf_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; -@@ -3237,14 +3237,15 @@ s3_bfd_score_elf_always_size_sections (b - - /* Set the sizes of the dynamic sections. */ - static bool --s3_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+s3_bfd_score_elf_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; - bool reltext; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -3313,7 +3314,7 @@ s3_bfd_score_elf_size_dynamic_sections ( - } - else if (startswith (name, ".got")) - { -- /* s3_bfd_score_elf_always_size_sections() has already done -+ /* s3_bfd_score_elf_early_size_sections() has already done - most of the work, but some symbols may have been mapped - to versions that we must now resolve in the got_entries - hash tables. */ -@@ -4177,22 +4178,22 @@ _bfd_score_elf_adjust_dynamic_symbol (st - } - - static bool --_bfd_score_elf_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+_bfd_score_elf_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - if (bfd_get_mach (output_bfd) == bfd_mach_score3) -- return s3_bfd_score_elf_always_size_sections (output_bfd, info); -+ return s3_bfd_score_elf_early_size_sections (output_bfd, info); - else -- return s7_bfd_score_elf_always_size_sections (output_bfd, info); -+ return s7_bfd_score_elf_early_size_sections (output_bfd, info); - } - - static bool --_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+_bfd_score_elf_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - if (bfd_get_mach (output_bfd) == bfd_mach_score3) -- return s3_bfd_score_elf_size_dynamic_sections (output_bfd, info); -+ return s3_bfd_score_elf_late_size_sections (output_bfd, info); - else -- return s7_bfd_score_elf_size_dynamic_sections (output_bfd, info); -+ return s7_bfd_score_elf_late_size_sections (output_bfd, info); - } - - static bool -@@ -4455,10 +4456,10 @@ _bfd_score_elf_common_definition (Elf_In - _bfd_score_elf_section_from_bfd_section - #define elf_backend_adjust_dynamic_symbol \ - _bfd_score_elf_adjust_dynamic_symbol --#define elf_backend_always_size_sections \ -- _bfd_score_elf_always_size_sections --#define elf_backend_size_dynamic_sections \ -- _bfd_score_elf_size_dynamic_sections -+#define elf_backend_early_size_sections \ -+ _bfd_score_elf_early_size_sections -+#define elf_backend_late_size_sections \ -+ _bfd_score_elf_late_size_sections - #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all - #define elf_backend_create_dynamic_sections \ - _bfd_score_elf_create_dynamic_sections ---- a/bfd/elf32-score.h -+++ b/bfd/elf32-score.h -@@ -78,10 +78,10 @@ s7_bfd_score_elf_adjust_dynamic_symbol ( - struct elf_link_hash_entry *); - - extern bool --s7_bfd_score_elf_always_size_sections (bfd *, struct bfd_link_info *); -+s7_bfd_score_elf_early_size_sections (bfd *, struct bfd_link_info *); - - extern bool --s7_bfd_score_elf_size_dynamic_sections (bfd *, struct bfd_link_info *); -+s7_bfd_score_elf_late_size_sections (bfd *, struct bfd_link_info *); - - extern bool - s7_bfd_score_elf_create_dynamic_sections (bfd *, struct bfd_link_info *); ---- a/bfd/elf32-score7.c -+++ b/bfd/elf32-score7.c -@@ -975,7 +975,7 @@ score_elf_got_info (bfd *abfd, asection - appear towards the end. This reduces the amount of GOT space - required. MAX_LOCAL is used to set the number of local symbols - known to be in the dynamic symbol table. During -- s7_bfd_score_elf_size_dynamic_sections, this value is 1. Afterward, the -+ s7_bfd_score_elf_late_size_sections, this value is 1. Afterward, the - section symbols are added and the count is higher. */ - - static bool -@@ -2969,8 +2969,8 @@ s7_bfd_score_elf_adjust_dynamic_symbol ( - and the input sections have been assigned to output sections. */ - - bool --s7_bfd_score_elf_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+s7_bfd_score_elf_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; -@@ -3047,14 +3047,15 @@ s7_bfd_score_elf_always_size_sections (b - /* Set the sizes of the dynamic sections. */ - - bool --s7_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+s7_bfd_score_elf_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; - bool reltext; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -3123,7 +3124,7 @@ s7_bfd_score_elf_size_dynamic_sections ( - } - else if (startswith (name, ".got")) - { -- /* s7_bfd_score_elf_always_size_sections() has already done -+ /* s7_bfd_score_elf_early_size_sections() has already done - most of the work, but some symbols may have been mapped - to versions that we must now resolve in the got_entries - hash tables. */ ---- a/bfd/elf32-sh.c -+++ b/bfd/elf32-sh.c -@@ -2925,7 +2925,7 @@ allocate_dynrelocs (struct elf_link_hash - It's a convenient place to determine the PLT style. */ - - static bool --sh_elf_always_size_sections (bfd *output_bfd, struct bfd_link_info *info) -+sh_elf_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - sh_elf_hash_table (info)->plt_info = get_plt_info (output_bfd, - bfd_link_pic (info)); -@@ -2940,8 +2940,8 @@ sh_elf_always_size_sections (bfd *output - /* Set the sizes of the dynamic sections. */ - - static bool --sh_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+sh_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_sh_link_hash_table *htab; - bfd *dynobj; -@@ -2954,7 +2954,8 @@ sh_elf_size_dynamic_sections (bfd *outpu - return false; - - dynobj = htab->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->root.dynamic_sections_created) - { -@@ -6589,10 +6590,8 @@ sh_elf_encode_eh_address (bfd *abfd, - sh_elf_link_hash_table_create - #define elf_backend_adjust_dynamic_symbol \ - sh_elf_adjust_dynamic_symbol --#define elf_backend_always_size_sections \ -- sh_elf_always_size_sections --#define elf_backend_size_dynamic_sections \ -- sh_elf_size_dynamic_sections -+#define elf_backend_early_size_sections sh_elf_early_size_sections -+#define elf_backend_late_size_sections sh_elf_late_size_sections - #define elf_backend_omit_section_dynsym sh_elf_omit_section_dynsym - #define elf_backend_finish_dynamic_symbol \ - sh_elf_finish_dynamic_symbol ---- a/bfd/elf32-sparc.c -+++ b/bfd/elf32-sparc.c -@@ -248,8 +248,7 @@ elf32_sparc_reloc_type_class (const stru - #define elf_backend_adjust_dynamic_symbol \ - _bfd_sparc_elf_adjust_dynamic_symbol - #define elf_backend_omit_section_dynsym _bfd_sparc_elf_omit_section_dynsym --#define elf_backend_size_dynamic_sections \ -- _bfd_sparc_elf_size_dynamic_sections -+#define elf_backend_late_size_sections _bfd_sparc_elf_late_size_sections - #define elf_backend_relocate_section _bfd_sparc_elf_relocate_section - #define elf_backend_finish_dynamic_symbol \ - _bfd_sparc_elf_finish_dynamic_symbol ---- a/bfd/elf32-tic6x.c -+++ b/bfd/elf32-tic6x.c -@@ -3160,7 +3160,7 @@ elf32_tic6x_allocate_dynrelocs (struct e - /* Set the sizes of the dynamic sections. */ - - static bool --elf32_tic6x_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+elf32_tic6x_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - struct elf32_tic6x_link_hash_table *htab; - bfd *dynobj; -@@ -3171,7 +3171,7 @@ elf32_tic6x_size_dynamic_sections (bfd * - htab = elf32_tic6x_hash_table (info); - dynobj = htab->elf.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - if (htab->elf.dynamic_sections_created) - { -@@ -3358,7 +3358,7 @@ elf32_tic6x_size_dynamic_sections (bfd * - and the input sections have been assigned to output sections. */ - - static bool --elf32_tic6x_always_size_sections (bfd *output_bfd, struct bfd_link_info *info) -+elf32_tic6x_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - if (elf32_tic6x_using_dsbt (output_bfd) && !bfd_link_relocatable (info) - && !bfd_elf_stack_segment_size (output_bfd, info, -@@ -4261,10 +4261,10 @@ elf32_tic6x_write_section (bfd *output_b - #define elf_backend_relocs_compatible _bfd_elf_relocs_compatible - #define elf_backend_finish_dynamic_symbol \ - elf32_tic6x_finish_dynamic_symbol --#define elf_backend_always_size_sections \ -- elf32_tic6x_always_size_sections --#define elf_backend_size_dynamic_sections \ -- elf32_tic6x_size_dynamic_sections -+#define elf_backend_early_size_sections \ -+ elf32_tic6x_early_size_sections -+#define elf_backend_late_size_sections \ -+ elf32_tic6x_late_size_sections - #define elf_backend_finish_dynamic_sections \ - elf32_tic6x_finish_dynamic_sections - #define bfd_elf32_bfd_final_link \ ---- a/bfd/elf32-tilegx.c -+++ b/bfd/elf32-tilegx.c -@@ -105,7 +105,7 @@ tilegx_elf_grok_psinfo (bfd *abfd, Elf_I - #define elf_backend_check_relocs tilegx_elf_check_relocs - #define elf_backend_adjust_dynamic_symbol tilegx_elf_adjust_dynamic_symbol - #define elf_backend_omit_section_dynsym tilegx_elf_omit_section_dynsym --#define elf_backend_size_dynamic_sections tilegx_elf_size_dynamic_sections -+#define elf_backend_late_size_sections tilegx_elf_late_size_sections - #define elf_backend_relocate_section tilegx_elf_relocate_section - #define elf_backend_finish_dynamic_symbol tilegx_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections tilegx_elf_finish_dynamic_sections ---- a/bfd/elf32-tilepro.c -+++ b/bfd/elf32-tilepro.c -@@ -2182,11 +2182,9 @@ tilepro_elf_omit_section_dynsym (bfd *ou - #define ELF32_DYNAMIC_INTERPRETER "/lib/ld.so.1" - - static bool --tilepro_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+tilepro_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { -- (void)output_bfd; -- - struct elf_link_hash_table *htab; - bfd *dynobj; - asection *s; -@@ -2195,7 +2193,8 @@ tilepro_elf_size_dynamic_sections (bfd * - htab = tilepro_elf_hash_table (info); - BFD_ASSERT (htab != NULL); - dynobj = htab->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -3739,7 +3738,7 @@ tilepro_additional_program_headers (bfd - #define elf_backend_check_relocs tilepro_elf_check_relocs - #define elf_backend_adjust_dynamic_symbol tilepro_elf_adjust_dynamic_symbol - #define elf_backend_omit_section_dynsym tilepro_elf_omit_section_dynsym --#define elf_backend_size_dynamic_sections tilepro_elf_size_dynamic_sections -+#define elf_backend_late_size_sections tilepro_elf_late_size_sections - #define elf_backend_relocate_section tilepro_elf_relocate_section - #define elf_backend_finish_dynamic_symbol tilepro_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections tilepro_elf_finish_dynamic_sections ---- a/bfd/elf32-vax.c -+++ b/bfd/elf32-vax.c -@@ -36,7 +36,6 @@ static bool elf_vax_check_relocs (bfd *, - asection *, const Elf_Internal_Rela *); - static bool elf_vax_adjust_dynamic_symbol (struct bfd_link_info *, - struct elf_link_hash_entry *); --static bool elf_vax_size_dynamic_sections (bfd *, struct bfd_link_info *); - static int elf_vax_relocate_section (bfd *, struct bfd_link_info *, - bfd *, asection *, bfd_byte *, - Elf_Internal_Rela *, -@@ -985,8 +984,8 @@ elf_vax_discard_got_entries (struct elf_ - /* Discard unused dynamic data if this is a static link. */ - - static bool --elf_vax_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_vax_early_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; -@@ -1024,14 +1023,15 @@ elf_vax_always_size_sections (bfd *outpu - /* Set the sizes of the dynamic sections. */ - - static bool --elf_vax_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+elf_vax_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; - bool relocs; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -1861,10 +1861,8 @@ elf_vax_plt_sym_val (bfd_vma i, const as - #define elf_backend_check_relocs elf_vax_check_relocs - #define elf_backend_adjust_dynamic_symbol \ - elf_vax_adjust_dynamic_symbol --#define elf_backend_always_size_sections \ -- elf_vax_always_size_sections --#define elf_backend_size_dynamic_sections \ -- elf_vax_size_dynamic_sections -+#define elf_backend_early_size_sections elf_vax_early_size_sections -+#define elf_backend_late_size_sections elf_vax_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section elf_vax_relocate_section - #define elf_backend_finish_dynamic_symbol \ ---- a/bfd/elf32-xstormy16.c -+++ b/bfd/elf32-xstormy16.c -@@ -706,8 +706,8 @@ xstormy16_elf_relax_section (bfd *dynobj - } - - static bool --xstormy16_elf_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+xstormy16_elf_early_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *splt; -@@ -1013,8 +1013,8 @@ xstormy16_elf_gc_mark_hook (asection *se - #define elf_backend_relocate_section xstormy16_elf_relocate_section - #define elf_backend_gc_mark_hook xstormy16_elf_gc_mark_hook - #define elf_backend_check_relocs xstormy16_elf_check_relocs --#define elf_backend_always_size_sections \ -- xstormy16_elf_always_size_sections -+#define elf_backend_early_size_sections \ -+ xstormy16_elf_early_size_sections - #define elf_backend_omit_section_dynsym \ - _bfd_elf_omit_section_dynsym_all - #define elf_backend_finish_dynamic_sections \ ---- a/bfd/elf32-xtensa.c -+++ b/bfd/elf32-xtensa.c -@@ -1568,8 +1568,8 @@ elf_xtensa_allocate_local_got_size (stru - /* Set the sizes of the dynamic sections. */ - - static bool --elf_xtensa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_xtensa_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_xtensa_link_hash_table *htab; - bfd *dynobj, *abfd; -@@ -1586,7 +1586,7 @@ elf_xtensa_size_dynamic_sections (bfd *o - - dynobj = elf_hash_table (info)->dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - srelgot = htab->elf.srelgot; - srelplt = htab->elf.srelplt; - -@@ -1791,8 +1791,7 @@ elf_xtensa_size_dynamic_sections (bfd *o - } - - static bool --elf_xtensa_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf_xtensa_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - struct elf_xtensa_link_hash_table *htab; - asection *tls_sec; -@@ -11551,8 +11550,8 @@ static const struct bfd_elf_special_sect - #define elf_backend_object_p elf_xtensa_object_p - #define elf_backend_reloc_type_class elf_xtensa_reloc_type_class - #define elf_backend_relocate_section elf_xtensa_relocate_section --#define elf_backend_size_dynamic_sections elf_xtensa_size_dynamic_sections --#define elf_backend_always_size_sections elf_xtensa_always_size_sections -+#define elf_backend_late_size_sections elf_xtensa_late_size_sections -+#define elf_backend_early_size_sections elf_xtensa_early_size_sections - #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all - #define elf_backend_special_sections elf_xtensa_special_sections - #define elf_backend_action_discarded elf_xtensa_action_discarded ---- a/bfd/elf64-alpha.c -+++ b/bfd/elf64-alpha.c -@@ -2579,8 +2579,8 @@ elf64_alpha_size_plt_section (struct bfd - } - - static bool --elf64_alpha_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf64_alpha_early_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *i; - struct alpha_elf_link_hash_table * htab; -@@ -2806,8 +2806,8 @@ elf64_alpha_size_rela_got_section (struc - /* Set the sizes of the dynamic sections. */ - - static bool --elf64_alpha_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf64_alpha_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; -@@ -2819,7 +2819,8 @@ elf64_alpha_size_dynamic_sections (bfd * - return false; - - dynobj = elf_hash_table(info)->dynobj; -- BFD_ASSERT(dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -5465,10 +5466,10 @@ static const struct elf_size_info alpha_ - elf64_alpha_merge_symbol_attribute - #define elf_backend_copy_indirect_symbol \ - elf64_alpha_copy_indirect_symbol --#define elf_backend_always_size_sections \ -- elf64_alpha_always_size_sections --#define elf_backend_size_dynamic_sections \ -- elf64_alpha_size_dynamic_sections -+#define elf_backend_early_size_sections \ -+ elf64_alpha_early_size_sections -+#define elf_backend_late_size_sections \ -+ elf64_alpha_late_size_sections - #define elf_backend_omit_section_dynsym \ - _bfd_elf_omit_section_dynsym_all - #define elf_backend_relocate_section \ ---- a/bfd/elf64-hppa.c -+++ b/bfd/elf64-hppa.c -@@ -176,9 +176,6 @@ static bool elf64_hppa_adjust_dynamic_sy - static bool elf64_hppa_mark_milli_and_exported_functions - (struct elf_link_hash_entry *, void *); - --static bool elf64_hppa_size_dynamic_sections -- (bfd *, struct bfd_link_info *); -- - static int elf64_hppa_link_output_symbol_hook - (struct bfd_link_info *, const char *, Elf_Internal_Sym *, - asection *, struct elf_link_hash_entry *); -@@ -1520,7 +1517,7 @@ elf64_hppa_mark_milli_and_exported_funct - the contents of our special sections. */ - - static bool --elf64_hppa_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+elf64_hppa_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - struct elf64_hppa_link_hash_table *hppa_info; - struct elf64_hppa_allocate_data data; -@@ -1534,7 +1531,8 @@ elf64_hppa_size_dynamic_sections (bfd *o - return false; - - dynobj = hppa_info->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - /* Mark each function this program exports so that we will allocate - space in the .opd section for each function's FPTR. If we are -@@ -3984,8 +3982,7 @@ const struct elf_size_info hppa64_elf_si - #define elf_backend_adjust_dynamic_symbol \ - elf64_hppa_adjust_dynamic_symbol - --#define elf_backend_size_dynamic_sections \ -- elf64_hppa_size_dynamic_sections -+#define elf_backend_late_size_sections elf64_hppa_late_size_sections - - #define elf_backend_finish_dynamic_symbol \ - elf64_hppa_finish_dynamic_symbol ---- a/bfd/elf64-ia64-vms.c -+++ b/bfd/elf64-ia64-vms.c -@@ -2590,8 +2590,8 @@ elf64_ia64_adjust_dynamic_symbol (struct - } - - static bool --elf64_ia64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf64_ia64_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf64_ia64_allocate_data data; - struct elf64_ia64_link_hash_table *ia64_info; -@@ -2600,11 +2600,12 @@ elf64_ia64_size_dynamic_sections (bfd *o - struct elf_link_hash_table *hash_table; - - hash_table = elf_hash_table (info); -- dynobj = hash_table->dynobj; - ia64_info = elf64_ia64_hash_table (info); - if (ia64_info == NULL) - return false; -- BFD_ASSERT(dynobj != NULL); -+ dynobj = hash_table->dynobj; -+ if (dynobj == NULL) -+ return true; - data.info = info; - - /* Allocate the GOT entries. */ -@@ -5484,8 +5485,8 @@ static const struct elf_size_info elf64_ - elf64_ia64_check_relocs - #define elf_backend_adjust_dynamic_symbol \ - elf64_ia64_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections \ -- elf64_ia64_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ elf64_ia64_late_size_sections - #define elf_backend_omit_section_dynsym \ - _bfd_elf_omit_section_dynsym_all - #define elf_backend_relocate_section \ ---- a/bfd/elf64-mips.c -+++ b/bfd/elf64-mips.c -@@ -4741,10 +4741,10 @@ const struct elf_size_info mips_elf64_si - #define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mips_elf_adjust_dynamic_symbol --#define elf_backend_always_size_sections \ -- _bfd_mips_elf_always_size_sections --#define elf_backend_size_dynamic_sections \ -- _bfd_mips_elf_size_dynamic_sections -+#define elf_backend_early_size_sections \ -+ _bfd_mips_elf_early_size_sections -+#define elf_backend_late_size_sections \ -+ _bfd_mips_elf_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section _bfd_mips_elf_relocate_section - #define elf_backend_finish_dynamic_symbol \ ---- a/bfd/elf64-ppc.c -+++ b/bfd/elf64-ppc.c -@@ -119,8 +119,8 @@ static bfd_vma opd_entry_value - #define elf_backend_adjust_dynamic_symbol ppc64_elf_adjust_dynamic_symbol - #define elf_backend_hide_symbol ppc64_elf_hide_symbol - #define elf_backend_maybe_function_sym ppc64_elf_maybe_function_sym --#define elf_backend_always_size_sections ppc64_elf_edit --#define elf_backend_size_dynamic_sections ppc64_elf_size_dynamic_sections -+#define elf_backend_early_size_sections ppc64_elf_edit -+#define elf_backend_late_size_sections ppc64_elf_late_size_sections - #define elf_backend_hash_symbol ppc64_elf_hash_symbol - #define elf_backend_init_index_section _bfd_elf_init_2_index_sections - #define elf_backend_action_discarded ppc64_elf_action_discarded -@@ -10121,7 +10121,7 @@ allocate_dynrelocs (struct elf_link_hash - ((((v) & 0x3ffff0000ULL) << 16) | (v & 0xffff)) - #define HA34(v) ((v + (1ULL << 33)) >> 34) - --/* Called via elf_link_hash_traverse from ppc64_elf_size_dynamic_sections -+/* Called via elf_link_hash_traverse from ppc64_elf_late_size_sections - to set up space for global entry stubs. These are put in glink, - after the branch table. */ - -@@ -10198,8 +10198,8 @@ size_global_entry_stubs (struct elf_link - /* Set the sizes of the dynamic sections. */ - - static bool --ppc64_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+ppc64_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - struct ppc_link_hash_table *htab; - bfd *dynobj; -@@ -10214,7 +10214,7 @@ ppc64_elf_size_dynamic_sections (bfd *ou - - dynobj = htab->elf.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - if (htab->elf.dynamic_sections_created) - { ---- a/bfd/elf64-s390.c -+++ b/bfd/elf64-s390.c -@@ -1301,7 +1301,7 @@ elf_s390_gc_mark_hook (asection *sec, - entry but we found we will not create any. Called when we find we will - not have any PLT for this symbol, by for example - elf_s390_adjust_dynamic_symbol when we're doing a proper dynamic link, -- or elf_s390_size_dynamic_sections if no dynamic sections will be -+ or elf_s390_late_size_sections if no dynamic sections will be - created (we're only linking static objects). */ - - static void -@@ -1714,8 +1714,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --elf_s390_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_s390_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_s390_link_hash_table *htab; - bfd *dynobj; -@@ -1729,7 +1729,7 @@ elf_s390_size_dynamic_sections (bfd *out - - dynobj = htab->elf.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - if (htab->elf.dynamic_sections_created) - { -@@ -3881,7 +3881,7 @@ const struct elf_size_info s390_elf64_si - #define elf_backend_gc_mark_hook elf_s390_gc_mark_hook - #define elf_backend_reloc_type_class elf_s390_reloc_type_class - #define elf_backend_relocate_section elf_s390_relocate_section --#define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections -+#define elf_backend_late_size_sections elf_s390_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_grok_prstatus elf_s390_grok_prstatus - #define elf_backend_grok_psinfo elf_s390_grok_psinfo ---- a/bfd/elf64-sparc.c -+++ b/bfd/elf64-sparc.c -@@ -938,8 +938,8 @@ const struct elf_size_info elf64_sparc_s - _bfd_sparc_elf_adjust_dynamic_symbol - #define elf_backend_omit_section_dynsym \ - _bfd_sparc_elf_omit_section_dynsym --#define elf_backend_size_dynamic_sections \ -- _bfd_sparc_elf_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ _bfd_sparc_elf_late_size_sections - #define elf_backend_relocate_section \ - _bfd_sparc_elf_relocate_section - #define elf_backend_finish_dynamic_symbol \ ---- a/bfd/elf64-tilegx.c -+++ b/bfd/elf64-tilegx.c -@@ -106,7 +106,7 @@ tilegx_elf_grok_psinfo (bfd *abfd, Elf_I - #define elf_backend_check_relocs tilegx_elf_check_relocs - #define elf_backend_adjust_dynamic_symbol tilegx_elf_adjust_dynamic_symbol - #define elf_backend_omit_section_dynsym tilegx_elf_omit_section_dynsym --#define elf_backend_size_dynamic_sections tilegx_elf_size_dynamic_sections -+#define elf_backend_late_size_sections tilegx_elf_late_size_sections - #define elf_backend_relocate_section tilegx_elf_relocate_section - #define elf_backend_finish_dynamic_symbol tilegx_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections tilegx_elf_finish_dynamic_sections ---- a/bfd/elf64-x86-64.c -+++ b/bfd/elf64-x86-64.c -@@ -2351,8 +2351,7 @@ elf_x86_64_scan_relocs (bfd *abfd, struc - } - - static bool --elf_x86_64_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf_x86_64_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - bfd *abfd; - -@@ -2365,7 +2364,7 @@ elf_x86_64_always_size_sections (bfd *ou - elf_x86_64_scan_relocs)) - return false; - -- return _bfd_x86_elf_always_size_sections (output_bfd, info); -+ return _bfd_x86_elf_early_size_sections (output_bfd, info); - } - - /* Return the relocation value for @tpoff relocation -@@ -5262,7 +5261,7 @@ elf_x86_64_special_sections[]= - elf_x86_64_reloc_name_lookup - - #define elf_backend_relocs_compatible elf_x86_64_relocs_compatible --#define elf_backend_always_size_sections elf_x86_64_always_size_sections -+#define elf_backend_early_size_sections elf_x86_64_early_size_sections - #define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections - #define elf_backend_finish_dynamic_sections elf_x86_64_finish_dynamic_sections - #define elf_backend_finish_dynamic_symbol elf_x86_64_finish_dynamic_symbol ---- a/bfd/elflink.c -+++ b/bfd/elflink.c -@@ -6623,8 +6623,8 @@ bfd_elf_size_dynamic_sections (bfd *outp - - /* The backend may have to create some sections regardless of whether - we're dynamic or not. */ -- if (bed->elf_backend_always_size_sections -- && ! (*bed->elf_backend_always_size_sections) (output_bfd, info)) -+ if (bed->elf_backend_early_size_sections -+ && !bed->elf_backend_early_size_sections (output_bfd, info)) - return false; - - dynobj = elf_hash_table (info)->dynobj; -@@ -7360,9 +7360,8 @@ bfd_elf_size_dynamic_sections (bfd *outp - - /* The backend must work out the sizes of all the other dynamic - sections. */ -- if (dynobj != NULL -- && bed->elf_backend_size_dynamic_sections != NULL -- && ! (*bed->elf_backend_size_dynamic_sections) (output_bfd, info)) -+ if (bed->elf_backend_late_size_sections != NULL -+ && !bed->elf_backend_late_size_sections (output_bfd, info)) - return false; - - if (dynobj != NULL && elf_hash_table (info)->dynamic_sections_created) ---- a/bfd/elfn32-mips.c -+++ b/bfd/elfn32-mips.c -@@ -4127,10 +4127,8 @@ static const struct ecoff_debug_swap mip - #define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mips_elf_adjust_dynamic_symbol --#define elf_backend_always_size_sections \ -- _bfd_mips_elf_always_size_sections --#define elf_backend_size_dynamic_sections \ -- _bfd_mips_elf_size_dynamic_sections -+#define elf_backend_early_size_sections _bfd_mips_elf_early_size_sections -+#define elf_backend_late_size_sections _bfd_mips_elf_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section _bfd_mips_elf_relocate_section - #define elf_backend_finish_dynamic_symbol \ ---- a/bfd/elfnn-aarch64.c -+++ b/bfd/elfnn-aarch64.c -@@ -112,7 +112,7 @@ - allocate space for one relocation on the slot. Record the GOT offset - for this symbol. - -- elfNN_aarch64_size_dynamic_sections () -+ elfNN_aarch64_late_size_sections () - - Iterate all input BFDS, look for in the local symbol data structure - constructed earlier for local TLS symbols and allocate them double -@@ -8859,8 +8859,8 @@ elfNN_aarch64_allocate_local_ifunc_dynre - though ! */ - - static bool --elfNN_aarch64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elfNN_aarch64_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_aarch64_link_hash_table *htab; - bfd *dynobj; -@@ -8871,7 +8871,8 @@ elfNN_aarch64_size_dynamic_sections (bfd - htab = elf_aarch64_hash_table ((info)); - dynobj = htab->root.dynobj; - -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->root.dynamic_sections_created) - { -@@ -9273,8 +9274,8 @@ elfNN_aarch64_create_small_pltn_entry (s - _TLS_MODULE_BASE_, if needed. */ - - static bool --elfNN_aarch64_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elfNN_aarch64_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - asection *tls_sec; - -@@ -10009,8 +10010,8 @@ const struct elf_size_info elfNN_aarch64 - #define elf_backend_adjust_dynamic_symbol \ - elfNN_aarch64_adjust_dynamic_symbol - --#define elf_backend_always_size_sections \ -- elfNN_aarch64_always_size_sections -+#define elf_backend_early_size_sections \ -+ elfNN_aarch64_early_size_sections - - #define elf_backend_check_relocs \ - elfNN_aarch64_check_relocs -@@ -10059,8 +10060,8 @@ const struct elf_size_info elfNN_aarch64 - #define elf_backend_section_from_shdr \ - elfNN_aarch64_section_from_shdr - --#define elf_backend_size_dynamic_sections \ -- elfNN_aarch64_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ elfNN_aarch64_late_size_sections - - #define elf_backend_size_info \ - elfNN_aarch64_size_info ---- a/bfd/elfnn-ia64.c -+++ b/bfd/elfnn-ia64.c -@@ -2986,8 +2986,8 @@ elfNN_ia64_adjust_dynamic_symbol (struct - } - - static bool --elfNN_ia64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elfNN_ia64_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elfNN_ia64_allocate_data data; - struct elfNN_ia64_link_hash_table *ia64_info; -@@ -2998,8 +2998,9 @@ elfNN_ia64_size_dynamic_sections (bfd *o - if (ia64_info == NULL) - return false; - dynobj = ia64_info->root.dynobj; -+ if (dynobj == NULL) -+ return true; - ia64_info->self_dtpmod_offset = (bfd_vma) -1; -- BFD_ASSERT(dynobj != NULL); - data.info = info; - - /* Set the contents of the .interp section to the interpreter. */ -@@ -5035,8 +5036,8 @@ ignore_errors (const char *fmt ATTRIBUTE - elfNN_ia64_check_relocs - #define elf_backend_adjust_dynamic_symbol \ - elfNN_ia64_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections \ -- elfNN_ia64_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ elfNN_ia64_late_size_sections - #define elf_backend_omit_section_dynsym \ - _bfd_elf_omit_section_dynsym_all - #define elf_backend_relocate_section \ ---- a/bfd/elfnn-loongarch.c -+++ b/bfd/elfnn-loongarch.c -@@ -1169,8 +1169,8 @@ maybe_set_textrel (struct elf_link_hash_ - } - - static bool --loongarch_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+loongarch_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - struct loongarch_elf_link_hash_table *htab; - bfd *dynobj; -@@ -1180,7 +1180,8 @@ loongarch_elf_size_dynamic_sections (bfd - htab = loongarch_elf_hash_table (info); - BFD_ASSERT (htab != NULL); - dynobj = htab->elf.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->elf.dynamic_sections_created) - { -@@ -3251,7 +3252,7 @@ loongarch_elf_gc_mark_hook (asection *se - loongarch_elf_create_dynamic_sections - #define elf_backend_check_relocs loongarch_elf_check_relocs - #define elf_backend_adjust_dynamic_symbol loongarch_elf_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections loongarch_elf_size_dynamic_sections -+#define elf_backend_late_size_sections loongarch_elf_late_size_sections - #define elf_backend_relocate_section loongarch_elf_relocate_section - #define elf_backend_finish_dynamic_symbol loongarch_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections \ ---- a/bfd/elfnn-riscv.c -+++ b/bfd/elfnn-riscv.c -@@ -1376,7 +1376,7 @@ allocate_local_ifunc_dynrelocs (void **s - } - - static bool --riscv_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+riscv_elf_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - struct riscv_elf_link_hash_table *htab; - bfd *dynobj; -@@ -1386,7 +1386,8 @@ riscv_elf_size_dynamic_sections (bfd *ou - htab = riscv_elf_hash_table (info); - BFD_ASSERT (htab != NULL); - dynobj = htab->elf.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -5256,7 +5257,7 @@ riscv_elf_merge_symbol_attribute (struct - #define elf_backend_create_dynamic_sections riscv_elf_create_dynamic_sections - #define elf_backend_check_relocs riscv_elf_check_relocs - #define elf_backend_adjust_dynamic_symbol riscv_elf_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections riscv_elf_size_dynamic_sections -+#define elf_backend_late_size_sections riscv_elf_late_size_sections - #define elf_backend_relocate_section riscv_elf_relocate_section - #define elf_backend_finish_dynamic_symbol riscv_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections riscv_elf_finish_dynamic_sections ---- a/bfd/elfxx-mips.c -+++ b/bfd/elfxx-mips.c -@@ -9550,8 +9550,8 @@ _bfd_mips_elf_adjust_dynamic_symbol (str - check for any mips16 stub sections that we can discard. */ - - bool --_bfd_mips_elf_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+_bfd_mips_elf_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - asection *sect; - struct mips_elf_link_hash_table *htab; -@@ -9894,8 +9894,8 @@ mips_elf_set_plt_sym_value (struct mips_ - /* Set the sizes of the dynamic sections. */ - - bool --_bfd_mips_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+_bfd_mips_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s, *sreldyn; -@@ -9905,7 +9905,8 @@ _bfd_mips_elf_size_dynamic_sections (bfd - htab = mips_elf_hash_table (info); - BFD_ASSERT (htab != NULL); - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -14824,7 +14825,7 @@ _bfd_mips_elf_final_link (bfd *abfd, str - input_section->flags &= ~SEC_HAS_CONTENTS; - } - -- /* Size has been set in _bfd_mips_elf_always_size_sections. */ -+ /* Size has been set in _bfd_mips_elf_early_size_sections. */ - BFD_ASSERT(o->size == sizeof (Elf_External_ABIFlags_v0)); - - /* Skip this section later on (I don't think this currently -@@ -14883,7 +14884,7 @@ _bfd_mips_elf_final_link (bfd *abfd, str - input_section->flags &= ~SEC_HAS_CONTENTS; - } - -- /* Size has been set in _bfd_mips_elf_always_size_sections. */ -+ /* Size has been set in _bfd_mips_elf_early_size_sections. */ - BFD_ASSERT(o->size == sizeof (Elf32_External_RegInfo)); - - /* Skip this section later on (I don't think this currently ---- a/bfd/elfxx-mips.h -+++ b/bfd/elfxx-mips.h -@@ -52,9 +52,9 @@ extern bool _bfd_mips_elf_check_relocs - (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *); - extern bool _bfd_mips_elf_adjust_dynamic_symbol - (struct bfd_link_info *, struct elf_link_hash_entry *); --extern bool _bfd_mips_elf_always_size_sections -+extern bool _bfd_mips_elf_early_size_sections - (bfd *, struct bfd_link_info *); --extern bool _bfd_mips_elf_size_dynamic_sections -+extern bool _bfd_mips_elf_late_size_sections - (bfd *, struct bfd_link_info *); - extern int _bfd_mips_elf_relocate_section - (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, ---- a/bfd/elfxx-sparc.c -+++ b/bfd/elfxx-sparc.c -@@ -2381,8 +2381,8 @@ _bfd_sparc_elf_omit_section_dynsym (bfd - /* Set the sizes of the dynamic sections. */ - - bool --_bfd_sparc_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+_bfd_sparc_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - struct _bfd_sparc_elf_link_hash_table *htab; - bfd *dynobj; -@@ -2392,7 +2392,8 @@ _bfd_sparc_elf_size_dynamic_sections (bf - htab = _bfd_sparc_elf_hash_table (info); - BFD_ASSERT (htab != NULL); - dynobj = htab->elf.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { ---- a/bfd/elfxx-sparc.h -+++ b/bfd/elfxx-sparc.h -@@ -117,7 +117,7 @@ extern bool _bfd_sparc_elf_adjust_dynami - (struct bfd_link_info *, struct elf_link_hash_entry *); - extern bool _bfd_sparc_elf_omit_section_dynsym - (bfd *, struct bfd_link_info *, asection *); --extern bool _bfd_sparc_elf_size_dynamic_sections -+extern bool _bfd_sparc_elf_late_size_sections - (bfd *, struct bfd_link_info *); - extern bool _bfd_sparc_elf_new_section_hook - (bfd *, asection *); ---- a/bfd/elfxx-target.h -+++ b/bfd/elfxx-target.h -@@ -493,11 +493,11 @@ - #ifndef elf_backend_adjust_dynamic_symbol - #define elf_backend_adjust_dynamic_symbol 0 - #endif --#ifndef elf_backend_always_size_sections --#define elf_backend_always_size_sections 0 -+#ifndef elf_backend_early_size_sections -+#define elf_backend_early_size_sections 0 - #endif --#ifndef elf_backend_size_dynamic_sections --#define elf_backend_size_dynamic_sections 0 -+#ifndef elf_backend_late_size_sections -+#define elf_backend_late_size_sections 0 - #endif - #ifndef elf_backend_strip_zero_sized_dynamic_sections - #define elf_backend_strip_zero_sized_dynamic_sections 0 -@@ -853,8 +853,8 @@ static const struct elf_backend_data elf - elf_backend_check_directives, - elf_backend_notice_as_needed, - elf_backend_adjust_dynamic_symbol, -- elf_backend_always_size_sections, -- elf_backend_size_dynamic_sections, -+ elf_backend_early_size_sections, -+ elf_backend_late_size_sections, - elf_backend_strip_zero_sized_dynamic_sections, - elf_backend_init_index_section, - elf_backend_relocate_section, ---- a/bfd/elfxx-tilegx.c -+++ b/bfd/elfxx-tilegx.c -@@ -2430,8 +2430,8 @@ tilegx_elf_omit_section_dynsym (bfd *out - } - - bool --tilegx_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+tilegx_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct tilegx_elf_link_hash_table *htab; - bfd *dynobj; -@@ -2441,7 +2441,8 @@ tilegx_elf_size_dynamic_sections (bfd *o - htab = tilegx_elf_hash_table (info); - BFD_ASSERT (htab != NULL); - dynobj = htab->elf.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { ---- a/bfd/elfxx-tilegx.h -+++ b/bfd/elfxx-tilegx.h -@@ -57,7 +57,7 @@ tilegx_elf_omit_section_dynsym (bfd *, - asection *); - - extern bool --tilegx_elf_size_dynamic_sections (bfd *, struct bfd_link_info *); -+tilegx_elf_late_size_sections (bfd *, struct bfd_link_info *); - - extern int - tilegx_elf_relocate_section (bfd *, struct bfd_link_info *, ---- a/bfd/elfxx-x86.c -+++ b/bfd/elfxx-x86.c -@@ -2002,7 +2002,7 @@ _bfd_elf_x86_valid_reloc_p (asection *in - /* Set the sizes of the dynamic sections. */ - - bool --_bfd_x86_elf_size_dynamic_sections (bfd *output_bfd, -+_bfd_x86_elf_late_size_sections (bfd *output_bfd, - struct bfd_link_info *info) - { - struct elf_x86_link_hash_table *htab; -@@ -2018,7 +2018,7 @@ _bfd_x86_elf_size_dynamic_sections (bfd - return false; - dynobj = htab->elf.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - /* Set up .got offsets for local syms, and space for local dynamic - relocs. */ -@@ -2599,8 +2599,8 @@ _bfd_x86_elf_finish_dynamic_sections (bf - - - bool --_bfd_x86_elf_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+_bfd_x86_elf_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - asection *tls_sec = elf_hash_table (info)->tls_sec; - ---- a/bfd/elfxx-x86.h -+++ b/bfd/elfxx-x86.h -@@ -807,13 +807,13 @@ extern bool _bfd_elf_x86_valid_reloc_p - const Elf_Internal_Rela *, struct elf_link_hash_entry *, - Elf_Internal_Sym *, Elf_Internal_Shdr *, bool *); - --extern bool _bfd_x86_elf_size_dynamic_sections -+extern bool _bfd_x86_elf_late_size_sections - (bfd *, struct bfd_link_info *); - - extern struct elf_x86_link_hash_table *_bfd_x86_elf_finish_dynamic_sections - (bfd *, struct bfd_link_info *); - --extern bool _bfd_x86_elf_always_size_sections -+extern bool _bfd_x86_elf_early_size_sections - (bfd *, struct bfd_link_info *); - - extern void _bfd_x86_elf_merge_symbol_attribute -@@ -885,8 +885,8 @@ extern void _bfd_x86_elf_link_report_rel - - #define elf_backend_check_relocs \ - _bfd_x86_elf_check_relocs --#define elf_backend_size_dynamic_sections \ -- _bfd_x86_elf_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ _bfd_x86_elf_late_size_sections - #define elf_backend_merge_symbol_attribute \ - _bfd_x86_elf_merge_symbol_attribute - #define elf_backend_copy_indirect_symbol \ ---- a/ld/emultempl/vms.em -+++ b/ld/emultempl/vms.em -@@ -196,10 +196,9 @@ gld${EMULATION_NAME}_before_allocation ( - - /* The backend must work out the sizes of all the other dynamic - sections. */ -- if (elf_hash_table (&link_info)->dynamic_sections_created -- && bed->elf_backend_size_dynamic_sections -- && ! (*bed->elf_backend_size_dynamic_sections) (link_info.output_bfd, -- &link_info)) -+ if (bed->elf_backend_late_size_sections -+ && !bed->elf_backend_late_size_sections (link_info.output_bfd, -+ &link_info)) - einfo (_("%F%P: failed to set dynamic section sizes: %E\n")); - - before_allocation_default (); diff --git a/toolchain/binutils/patches/2.38/002-PR-30569-delete-_bfd_mips_elf_early_size_sections.patch b/toolchain/binutils/patches/2.38/002-PR-30569-delete-_bfd_mips_elf_early_size_sections.patch deleted file mode 100644 index 725d676510..0000000000 --- a/toolchain/binutils/patches/2.38/002-PR-30569-delete-_bfd_mips_elf_early_size_sections.patch +++ /dev/null @@ -1,218 +0,0 @@ -From 3c6c32951e292a51ede70b8087bb0308d7dbc4fc Mon Sep 17 00:00:00 2001 -From: Alan Modra <amodra@gmail.com> -Date: Thu, 28 Mar 2024 20:33:32 +1030 -Subject: [PATCH 2/2] PR 30569, delete _bfd_mips_elf_early_size_sections - -PR30569 was triggered by a patch of mine 6540edd52cc0 moving the call -to always_size_sections in bfd_elf_size_dynamic_sections earlier, made -to support the x86 DT_RELR implementation. This broke mips16 code -handling stubs when --export-dynamic is passed to the linker, because -numerous symbols then became dynamic after always_size_sections. The -mips backend fiddles with symbols in its always_size_sections. Maciej -in 902e9fc76a0e had moved the call to always_size_sections to after -the export-dynamic code. Prior to that, Nathan in 04c3a75556c0 moved -it before the exec stack code, back to the start of -bfd_elf_size_dynamic_sections which was where Ian put it originally -in ff12f303355b. So the call has moved around a little. I'm leaving -it where it is, and instead calling mips_elf_check_symbols from -late_size_sections (the old size_dynamic_sections) which is now always -called. In fact, the whole of _bfd_mips_elf_early_size_sections can -be merged into _bfd_mips_elf_late_size_sections. ---- - bfd/elf32-mips.c | 1 - - bfd/elf64-mips.c | 2 -- - bfd/elfn32-mips.c | 1 - - bfd/elfxx-mips.c | 84 +++++++++++++++++++---------------------------- - bfd/elfxx-mips.h | 2 -- - 5 files changed, 34 insertions(+), 56 deletions(-) - ---- a/bfd/elf32-mips.c -+++ b/bfd/elf32-mips.c -@@ -2526,7 +2526,6 @@ static const struct ecoff_debug_swap mip - #define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mips_elf_adjust_dynamic_symbol --#define elf_backend_early_size_sections _bfd_mips_elf_early_size_sections - #define elf_backend_late_size_sections _bfd_mips_elf_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section _bfd_mips_elf_relocate_section ---- a/bfd/elf64-mips.c -+++ b/bfd/elf64-mips.c -@@ -4741,8 +4741,6 @@ const struct elf_size_info mips_elf64_si - #define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mips_elf_adjust_dynamic_symbol --#define elf_backend_early_size_sections \ -- _bfd_mips_elf_early_size_sections - #define elf_backend_late_size_sections \ - _bfd_mips_elf_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section ---- a/bfd/elfn32-mips.c -+++ b/bfd/elfn32-mips.c -@@ -4127,7 +4127,6 @@ static const struct ecoff_debug_swap mip - #define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mips_elf_adjust_dynamic_symbol --#define elf_backend_early_size_sections _bfd_mips_elf_early_size_sections - #define elf_backend_late_size_sections _bfd_mips_elf_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section _bfd_mips_elf_relocate_section ---- a/bfd/elfxx-mips.c -+++ b/bfd/elfxx-mips.c -@@ -9545,48 +9545,6 @@ _bfd_mips_elf_adjust_dynamic_symbol (str - return _bfd_elf_adjust_dynamic_copy (info, h, s); - } - --/* This function is called after all the input files have been read, -- and the input sections have been assigned to output sections. We -- check for any mips16 stub sections that we can discard. */ -- --bool --_bfd_mips_elf_early_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) --{ -- asection *sect; -- struct mips_elf_link_hash_table *htab; -- struct mips_htab_traverse_info hti; -- -- htab = mips_elf_hash_table (info); -- BFD_ASSERT (htab != NULL); -- -- /* The .reginfo section has a fixed size. */ -- sect = bfd_get_section_by_name (output_bfd, ".reginfo"); -- if (sect != NULL) -- { -- bfd_set_section_size (sect, sizeof (Elf32_External_RegInfo)); -- sect->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS; -- } -- -- /* The .MIPS.abiflags section has a fixed size. */ -- sect = bfd_get_section_by_name (output_bfd, ".MIPS.abiflags"); -- if (sect != NULL) -- { -- bfd_set_section_size (sect, sizeof (Elf_External_ABIFlags_v0)); -- sect->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS; -- } -- -- hti.info = info; -- hti.output_bfd = output_bfd; -- hti.error = false; -- mips_elf_link_hash_traverse (mips_elf_hash_table (info), -- mips_elf_check_symbols, &hti); -- if (hti.error) -- return false; -- -- return true; --} -- - /* If the link uses a GOT, lay it out and work out its size. */ - - static bool -@@ -9891,7 +9849,8 @@ mips_elf_set_plt_sym_value (struct mips_ - return true; - } - --/* Set the sizes of the dynamic sections. */ -+/* Set the sizes of the dynamic sections, some mips non-dynamic sections, -+ and check for any mips16 stub sections that we can discard. */ - - bool - _bfd_mips_elf_late_size_sections (bfd *output_bfd, -@@ -9901,14 +9860,39 @@ _bfd_mips_elf_late_size_sections (bfd *o - asection *s, *sreldyn; - bool reltext; - struct mips_elf_link_hash_table *htab; -+ struct mips_htab_traverse_info hti; - - htab = mips_elf_hash_table (info); - BFD_ASSERT (htab != NULL); -- dynobj = elf_hash_table (info)->dynobj; -+ -+ /* The .reginfo section has a fixed size. */ -+ s = bfd_get_section_by_name (output_bfd, ".reginfo"); -+ if (s != NULL) -+ { -+ bfd_set_section_size (s, sizeof (Elf32_External_RegInfo)); -+ s->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS; -+ } -+ -+ /* The .MIPS.abiflags section has a fixed size. */ -+ s = bfd_get_section_by_name (output_bfd, ".MIPS.abiflags"); -+ if (s != NULL) -+ { -+ bfd_set_section_size (s, sizeof (Elf_External_ABIFlags_v0)); -+ s->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS; -+ } -+ -+ hti.info = info; -+ hti.output_bfd = output_bfd; -+ hti.error = false; -+ mips_elf_link_hash_traverse (htab, mips_elf_check_symbols, &hti); -+ if (hti.error) -+ return false; -+ -+ dynobj = htab->root.dynobj; - if (dynobj == NULL) - return true; - -- if (elf_hash_table (info)->dynamic_sections_created) -+ if (htab->root.dynamic_sections_created) - { - /* Set the contents of the .interp section to the interpreter. */ - if (bfd_link_executable (info) && !info->nointerp) -@@ -10048,7 +10032,7 @@ _bfd_mips_elf_late_size_sections (bfd *o - } - } - else if (bfd_link_executable (info) -- && ! mips_elf_hash_table (info)->use_rld_obj_head -+ && !htab->use_rld_obj_head - && startswith (name, ".rld_map")) - { - /* We add a room for __rld_map. It will be filled in by the -@@ -10057,7 +10041,7 @@ _bfd_mips_elf_late_size_sections (bfd *o - } - else if (SGI_COMPAT (output_bfd) - && startswith (name, ".compact_rel")) -- s->size += mips_elf_hash_table (info)->compact_rel_size; -+ s->size += htab->compact_rel_size; - else if (s == htab->root.splt) - { - /* If the last PLT entry has a branch delay slot, allocate -@@ -10097,7 +10081,7 @@ _bfd_mips_elf_late_size_sections (bfd *o - } - } - -- if (elf_hash_table (info)->dynamic_sections_created) -+ if (htab->root.dynamic_sections_created) - { - /* Add some entries to the .dynamic section. We fill in the - values later, in _bfd_mips_elf_finish_dynamic_sections, but we -@@ -14825,7 +14809,7 @@ _bfd_mips_elf_final_link (bfd *abfd, str - input_section->flags &= ~SEC_HAS_CONTENTS; - } - -- /* Size has been set in _bfd_mips_elf_early_size_sections. */ -+ /* Size has been set in _bfd_mips_elf_late_size_sections. */ - BFD_ASSERT(o->size == sizeof (Elf_External_ABIFlags_v0)); - - /* Skip this section later on (I don't think this currently -@@ -14884,7 +14868,7 @@ _bfd_mips_elf_final_link (bfd *abfd, str - input_section->flags &= ~SEC_HAS_CONTENTS; - } - -- /* Size has been set in _bfd_mips_elf_early_size_sections. */ -+ /* Size has been set in _bfd_mips_elf_late_size_sections. */ - BFD_ASSERT(o->size == sizeof (Elf32_External_RegInfo)); - - /* Skip this section later on (I don't think this currently ---- a/bfd/elfxx-mips.h -+++ b/bfd/elfxx-mips.h -@@ -52,8 +52,6 @@ extern bool _bfd_mips_elf_check_relocs - (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *); - extern bool _bfd_mips_elf_adjust_dynamic_symbol - (struct bfd_link_info *, struct elf_link_hash_entry *); --extern bool _bfd_mips_elf_early_size_sections -- (bfd *, struct bfd_link_info *); - extern bool _bfd_mips_elf_late_size_sections - (bfd *, struct bfd_link_info *); - extern int _bfd_mips_elf_relocate_section diff --git a/toolchain/binutils/patches/2.38/400-mips_no_dynamic_linking_sym.patch b/toolchain/binutils/patches/2.38/400-mips_no_dynamic_linking_sym.patch deleted file mode 100644 index 070247ecf0..0000000000 --- a/toolchain/binutils/patches/2.38/400-mips_no_dynamic_linking_sym.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/bfd/elfxx-mips.c -+++ b/bfd/elfxx-mips.c -@@ -8057,6 +8057,7 @@ _bfd_mips_elf_create_dynamic_sections (b - - name = SGI_COMPAT (abfd) ? "_DYNAMIC_LINK" : "_DYNAMIC_LINKING"; - bh = NULL; -+ if (0) { - if (!(_bfd_generic_link_add_one_symbol - (info, abfd, name, BSF_GLOBAL, bfd_abs_section_ptr, 0, - NULL, false, get_elf_backend_data (abfd)->collect, &bh))) -@@ -8069,6 +8070,7 @@ _bfd_mips_elf_create_dynamic_sections (b - - if (! bfd_elf_link_record_dynamic_symbol (info, h)) - return false; -+ } - - if (! mips_elf_hash_table (info)->use_rld_obj_head) - { diff --git a/toolchain/binutils/patches/2.38/500-Change-default-emulation-for-mips64-linux.patch b/toolchain/binutils/patches/2.38/500-Change-default-emulation-for-mips64-linux.patch deleted file mode 100644 index 0797f4dff9..0000000000 --- a/toolchain/binutils/patches/2.38/500-Change-default-emulation-for-mips64-linux.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- a/bfd/config.bfd -+++ b/bfd/config.bfd -@@ -928,12 +928,12 @@ case "${targ}" in - targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_be_vec mips_ecoff_le_vec" - ;; - mips64*el-*-linux*) -- targ_defvec=mips_elf32_ntrad_le_vec -- targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec" -+ targ_defvec=mips_elf64_trad_le_vec -+ targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_be_vec" - ;; - mips64*-*-linux*) -- targ_defvec=mips_elf32_ntrad_be_vec -- targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec" -+ targ_defvec=mips_elf64_trad_be_vec -+ targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_le_vec" - ;; - mips*el-*-linux*) - targ_defvec=mips_elf32_trad_le_vec ---- a/ld/configure.tgt -+++ b/ld/configure.tgt -@@ -543,12 +543,12 @@ mips*-*-vxworks*) targ_emul=elf32ebmipvx - ;; - mips*-*-windiss) targ_emul=elf32mipswindiss - ;; --mips64*el-*-linux-*) targ_emul=elf32ltsmipn32 -- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip" -+mips64*el-*-linux-*) targ_emul=elf64ltsmip -+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32ltsmip elf32btsmip elf64btsmip" - targ_extra_libpath=$targ_extra_emuls - ;; --mips64*-*-linux-*) targ_emul=elf32btsmipn32 -- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip" -+mips64*-*-linux-*) targ_emul=elf64btsmip -+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip" - targ_extra_libpath=$targ_extra_emuls - ;; - mips*el-*-linux-*) targ_emul=elf32ltsmip diff --git a/toolchain/binutils/patches/2.39/001-PR-30569-always-call-elf_backend_size_dynamic_sectio.patch b/toolchain/binutils/patches/2.39/001-PR-30569-always-call-elf_backend_size_dynamic_sectio.patch deleted file mode 100644 index 84b99172f7..0000000000 --- a/toolchain/binutils/patches/2.39/001-PR-30569-always-call-elf_backend_size_dynamic_sectio.patch +++ /dev/null @@ -1,2172 +0,0 @@ -From af969b14aedcc0ae27dcefab4327ff2d153dec8b Mon Sep 17 00:00:00 2001 -From: Alan Modra <amodra@gmail.com> -Date: Thu, 28 Mar 2024 19:25:42 +1030 -Subject: [PATCH 1/2] PR 30569, always call elf_backend_size_dynamic_sections - -This largely mechanical patch is preparation for a followup patch. - -For quite some time I've thought that it would be useful to call -elf_backend_size_dynamic_sections even when no dynamic objects are -seen by the linker. That's what this patch does, with some renaming. -There are no functional changes to the linker, just a move of the -dynobj test in bfd_elf_size_dynamic_sections to target backend -functions, replacing the asserts/aborts already there. No doubt some -of the current always_size_sections functions could be moved to -size_dynamic_sections but I haven't made that change. - -Because both hooks are now always called, I have renamed -always_size_sections to early_size_sections and size_dynamic_sections -to late_size_sections. I condisdered calling late_size_sections plain -size_sections, since this is the usual target dynamic section sizing -hook, but decided that searching the sources for "size_sections" would -then hit early_size_sections and other functions. ---- - bfd/elf-bfd.h | 35 +++++++++++++++++------------------ - bfd/elf-m10300.c | 11 ++++++----- - bfd/elf32-arc.c | 9 +++++---- - bfd/elf32-arm.c | 15 ++++++++------- - bfd/elf32-bfin.c | 31 ++++++++++++++++--------------- - bfd/elf32-cr16.c | 11 ++++++----- - bfd/elf32-cris.c | 13 +++++++------ - bfd/elf32-csky.c | 8 ++++---- - bfd/elf32-frv.c | 23 ++++++++++++----------- - bfd/elf32-hppa.c | 8 ++++---- - bfd/elf32-i386.c | 7 +++---- - bfd/elf32-lm32.c | 15 ++++++++------- - bfd/elf32-m32c.c | 8 ++++---- - bfd/elf32-m32r.c | 11 ++++++----- - bfd/elf32-m68k.c | 16 ++++++++-------- - bfd/elf32-metag.c | 8 ++++---- - bfd/elf32-microblaze.c | 9 +++++---- - bfd/elf32-mips.c | 6 ++---- - bfd/elf32-nds32.c | 9 +++++---- - bfd/elf32-nios2.c | 15 ++++++++------- - bfd/elf32-or1k.c | 9 +++++---- - bfd/elf32-ppc.c | 11 ++++++----- - bfd/elf32-rl78.c | 8 ++++---- - bfd/elf32-s390.c | 10 +++++----- - bfd/elf32-score.c | 35 ++++++++++++++++++----------------- - bfd/elf32-score.h | 4 ++-- - bfd/elf32-score7.c | 13 +++++++------ - bfd/elf32-sh.c | 15 +++++++-------- - bfd/elf32-sparc.c | 3 +-- - bfd/elf32-tic6x.c | 14 +++++++------- - bfd/elf32-tilegx.c | 2 +- - bfd/elf32-tilepro.c | 11 +++++------ - bfd/elf32-vax.c | 16 +++++++--------- - bfd/elf32-xstormy16.c | 8 ++++---- - bfd/elf32-xtensa.c | 13 ++++++------- - bfd/elf64-alpha.c | 19 ++++++++++--------- - bfd/elf64-hppa.c | 11 ++++------- - bfd/elf64-ia64-vms.c | 13 +++++++------ - bfd/elf64-mips.c | 8 ++++---- - bfd/elf64-ppc.c | 12 ++++++------ - bfd/elf64-s390.c | 10 +++++----- - bfd/elf64-sparc.c | 4 ++-- - bfd/elf64-tilegx.c | 2 +- - bfd/elf64-x86-64.c | 7 +++---- - bfd/elflink.c | 9 ++++----- - bfd/elfn32-mips.c | 6 ++---- - bfd/elfnn-aarch64.c | 21 +++++++++++---------- - bfd/elfnn-ia64.c | 11 ++++++----- - bfd/elfnn-kvx.c | 19 +++++++++---------- - bfd/elfnn-loongarch.c | 9 +++++---- - bfd/elfnn-riscv.c | 7 ++++--- - bfd/elfxx-mips.c | 15 ++++++++------- - bfd/elfxx-mips.h | 4 ++-- - bfd/elfxx-sparc.c | 7 ++++--- - bfd/elfxx-sparc.h | 2 +- - bfd/elfxx-target.h | 12 ++++++------ - bfd/elfxx-tilegx.c | 7 ++++--- - bfd/elfxx-tilegx.h | 2 +- - bfd/elfxx-x86.c | 8 ++++---- - bfd/elfxx-x86.h | 8 ++++---- - ld/emultempl/vms.em | 7 +++---- - 61 files changed, 343 insertions(+), 337 deletions(-) - ---- a/bfd/elf-bfd.h -+++ b/bfd/elf-bfd.h -@@ -1136,7 +1136,7 @@ struct elf_backend_data - /* The ADJUST_DYNAMIC_SYMBOL function is called by the ELF backend - linker for every symbol which is defined by a dynamic object and - referenced by a regular object. This is called after all the -- input files have been seen, but before the SIZE_DYNAMIC_SECTIONS -+ input files have been seen, but before the LATE_SIZE_SECTIONS - function has been called. The hash table entry should be - bfd_link_hash_defined ore bfd_link_hash_defweak, and it should be - defined in a section from a dynamic object. Dynamic object -@@ -1148,24 +1148,23 @@ struct elf_backend_data - bool (*elf_backend_adjust_dynamic_symbol) - (struct bfd_link_info *info, struct elf_link_hash_entry *h); - -- /* The ALWAYS_SIZE_SECTIONS function is called by the backend linker -- after all the linker input files have been seen but before the -- section sizes have been set. This is called after -- ADJUST_DYNAMIC_SYMBOL, but before SIZE_DYNAMIC_SECTIONS. */ -- bool (*elf_backend_always_size_sections) -+ /* The EARLY_SIZE_SECTIONS and LATE_SIZE_SECTIONS functions are -+ called by the backend linker after all linker input files have -+ been seen and sections have been assigned to output sections, but -+ before the section sizes have been set. Both of these functions -+ are called even when no dynamic object is seen by the linker. -+ Between them, they must set the sizes of the dynamic sections and -+ other backend specific sections, and may fill in their contents. -+ Most backends need only use LATE_SIZE_SECTIONS. -+ EARLY_SIZE_SECTIONS is called before --export-dynamic makes some -+ symbols dynamic and before ADJUST_DYNAMIC_SYMBOL processes -+ dynamic symbols, LATE_SIZE_SECTIONS afterwards. The generic ELF -+ linker can handle the .dynsym, .dynstr and .hash sections. -+ Besides those, these functions must handle the .interp section -+ and any other sections created by CREATE_DYNAMIC_SECTIONS. */ -+ bool (*elf_backend_early_size_sections) - (bfd *output_bfd, struct bfd_link_info *info); -- -- /* The SIZE_DYNAMIC_SECTIONS function is called by the ELF backend -- linker after all the linker input files have been seen but before -- the sections sizes have been set. This is called after -- ADJUST_DYNAMIC_SYMBOL has been called on all appropriate symbols. -- It is only called when linking against a dynamic object. It must -- set the sizes of the dynamic sections, and may fill in their -- contents as well. The generic ELF linker can handle the .dynsym, -- .dynstr and .hash sections. This function must handle the -- .interp section and any sections created by the -- CREATE_DYNAMIC_SECTIONS entry point. */ -- bool (*elf_backend_size_dynamic_sections) -+ bool (*elf_backend_late_size_sections) - (bfd *output_bfd, struct bfd_link_info *info); - - /* The STRIP_ZERO_SIZED_DYNAMIC_SECTIONS function is called by the ---- a/bfd/elf-m10300.c -+++ b/bfd/elf-m10300.c -@@ -5003,8 +5003,8 @@ _bfd_mn10300_elf_adjust_dynamic_symbol ( - /* Set the sizes of the dynamic sections. */ - - static bool --_bfd_mn10300_elf_size_dynamic_sections (bfd * output_bfd, -- struct bfd_link_info * info) -+_bfd_mn10300_elf_late_size_sections (bfd * output_bfd, -+ struct bfd_link_info * info) - { - struct elf32_mn10300_link_hash_table *htab = elf32_mn10300_hash_table (info); - bfd * dynobj; -@@ -5012,7 +5012,8 @@ _bfd_mn10300_elf_size_dynamic_sections ( - bool relocs; - - dynobj = htab->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -5499,8 +5500,8 @@ mn10300_elf_mkobject (bfd *abfd) - _bfd_mn10300_elf_create_dynamic_sections - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mn10300_elf_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections \ -- _bfd_mn10300_elf_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ _bfd_mn10300_elf_late_size_sections - #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all - #define elf_backend_finish_dynamic_symbol \ - _bfd_mn10300_elf_finish_dynamic_symbol ---- a/bfd/elf32-arc.c -+++ b/bfd/elf32-arc.c -@@ -2702,8 +2702,8 @@ elf_arc_finish_dynamic_sections (bfd * o - - /* Set the sizes of the dynamic sections. */ - static bool --elf_arc_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_arc_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; -@@ -2711,7 +2711,8 @@ elf_arc_size_dynamic_sections (bfd *outp - struct elf_link_hash_table *htab = elf_hash_table (info); - - dynobj = htab->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->dynamic_sections_created) - { -@@ -3126,7 +3127,7 @@ arc_elf_relax_section (bfd *abfd, asecti - #define elf_backend_finish_dynamic_symbol elf_arc_finish_dynamic_symbol - - #define elf_backend_finish_dynamic_sections elf_arc_finish_dynamic_sections --#define elf_backend_size_dynamic_sections elf_arc_size_dynamic_sections -+#define elf_backend_late_size_sections elf_arc_late_size_sections - - #define elf_backend_can_gc_sections 1 - #define elf_backend_want_got_plt 1 ---- a/bfd/elf32-arm.c -+++ b/bfd/elf32-arm.c -@@ -16729,8 +16729,8 @@ bfd_elf32_arm_set_byteswap_code (struct - /* Set the sizes of the dynamic sections. */ - - static bool --elf32_arm_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info * info) -+elf32_arm_late_size_sections (bfd * output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info * info) - { - bfd * dynobj; - asection * s; -@@ -16743,7 +16743,9 @@ elf32_arm_size_dynamic_sections (bfd * o - return false; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; -+ - check_use_blx (htab); - - if (elf_hash_table (info)->dynamic_sections_created) -@@ -17115,8 +17117,7 @@ elf32_arm_size_dynamic_sections (bfd * o - _TLS_MODULE_BASE_, if needed. */ - - static bool --elf32_arm_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf32_arm_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - asection *tls_sec; - struct elf32_arm_link_hash_table *htab; -@@ -20283,8 +20284,8 @@ elf32_arm_backend_symbol_processing (bfd - #define elf_backend_create_dynamic_sections elf32_arm_create_dynamic_sections - #define elf_backend_finish_dynamic_symbol elf32_arm_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections elf32_arm_finish_dynamic_sections --#define elf_backend_size_dynamic_sections elf32_arm_size_dynamic_sections --#define elf_backend_always_size_sections elf32_arm_always_size_sections -+#define elf_backend_late_size_sections elf32_arm_late_size_sections -+#define elf_backend_early_size_sections elf32_arm_early_size_sections - #define elf_backend_init_index_section _bfd_elf_init_2_index_sections - #define elf_backend_init_file_header elf32_arm_init_file_header - #define elf_backend_reloc_type_class elf32_arm_reloc_type_class ---- a/bfd/elf32-bfin.c -+++ b/bfd/elf32-bfin.c -@@ -4027,8 +4027,8 @@ _bfinfdpic_size_got_plt (bfd *output_bfd - /* Set the sizes of the dynamic sections. */ - - static bool --elf32_bfinfdpic_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf32_bfinfdpic_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - struct elf_link_hash_table *htab; - bfd *dynobj; -@@ -4037,7 +4037,8 @@ elf32_bfinfdpic_size_dynamic_sections (b - - htab = elf_hash_table (info); - dynobj = htab->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->dynamic_sections_created) - { -@@ -4086,7 +4087,7 @@ elf32_bfinfdpic_size_dynamic_sections (b - } - - static bool --elf32_bfinfdpic_always_size_sections (bfd *output_bfd, -+elf32_bfinfdpic_early_size_sections (bfd *output_bfd, - struct bfd_link_info *info) - { - if (!bfd_link_relocatable (info) -@@ -5124,15 +5125,16 @@ bfin_discard_copies (struct elf_link_has - } - - static bool --bfin_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+bfin_late_size_sections (bfd * output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; - bool relocs; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -5424,8 +5426,7 @@ struct bfd_elf_special_section const elf - #define elf_backend_check_relocs bfin_check_relocs - #define elf_backend_adjust_dynamic_symbol \ - bfin_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections \ -- bfin_size_dynamic_sections -+#define elf_backend_late_size_sections bfin_late_size_sections - #define elf_backend_relocate_section bfin_relocate_section - #define elf_backend_finish_dynamic_symbol \ - bfin_finish_dynamic_symbol -@@ -5471,9 +5472,9 @@ struct bfd_elf_special_section const elf - #undef bfd_elf32_bfd_link_hash_table_create - #define bfd_elf32_bfd_link_hash_table_create \ - bfinfdpic_elf_link_hash_table_create --#undef elf_backend_always_size_sections --#define elf_backend_always_size_sections \ -- elf32_bfinfdpic_always_size_sections -+#undef elf_backend_early_size_sections -+#define elf_backend_early_size_sections \ -+ elf32_bfinfdpic_early_size_sections - - #undef elf_backend_create_dynamic_sections - #define elf_backend_create_dynamic_sections \ -@@ -5481,9 +5482,9 @@ struct bfd_elf_special_section const elf - #undef elf_backend_adjust_dynamic_symbol - #define elf_backend_adjust_dynamic_symbol \ - elf32_bfinfdpic_adjust_dynamic_symbol --#undef elf_backend_size_dynamic_sections --#define elf_backend_size_dynamic_sections \ -- elf32_bfinfdpic_size_dynamic_sections -+#undef elf_backend_late_size_sections -+#define elf_backend_late_size_sections \ -+ elf32_bfinfdpic_late_size_sections - #undef elf_backend_finish_dynamic_symbol - #define elf_backend_finish_dynamic_symbol \ - elf32_bfinfdpic_finish_dynamic_symbol ---- a/bfd/elf32-cr16.c -+++ b/bfd/elf32-cr16.c -@@ -2381,15 +2381,16 @@ _bfd_cr16_elf_adjust_dynamic_symbol (str - /* Set the sizes of the dynamic sections. */ - - static bool --_bfd_cr16_elf_size_dynamic_sections (bfd * output_bfd, -- struct bfd_link_info * info) -+_bfd_cr16_elf_late_size_sections (bfd * output_bfd, -+ struct bfd_link_info * info) - { - bfd * dynobj; - asection * s; - bool relocs; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -2826,8 +2827,8 @@ _bfd_cr16_elf_reloc_type_class (const st - _bfd_cr16_elf_create_dynamic_sections - #define elf_backend_adjust_dynamic_symbol \ - _bfd_cr16_elf_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections \ -- _bfd_cr16_elf_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ _bfd_cr16_elf_late_size_sections - #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all - #define elf_backend_finish_dynamic_symbol \ - _bfd_cr16_elf_finish_dynamic_symbol ---- a/bfd/elf32-cris.c -+++ b/bfd/elf32-cris.c -@@ -2527,7 +2527,7 @@ cris_elf_plt_sym_val (bfd_vma i ATTRIBUT - entry but we found we will not create any. Called when we find we will - not have any PLT for this symbol, by for example - elf_cris_adjust_dynamic_symbol when we're doing a proper dynamic link, -- or elf_cris_size_dynamic_sections if no dynamic sections will be -+ or elf_cris_late_size_sections if no dynamic sections will be - created (we're only linking static objects). */ - - static bool -@@ -3508,8 +3508,8 @@ cris_elf_check_relocs (bfd *abfd, - /* Set the sizes of the dynamic sections. */ - - static bool --elf_cris_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_cris_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_cris_link_hash_table * htab; - bfd *dynobj; -@@ -3521,7 +3521,8 @@ elf_cris_size_dynamic_sections (bfd *out - return false; - - dynobj = htab->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->root.dynamic_sections_created) - { -@@ -4090,8 +4091,8 @@ elf_cris_got_elt_size (bfd *abfd ATTRIBU - elf_cris_adjust_dynamic_symbol - #define elf_backend_copy_indirect_symbol \ - elf_cris_copy_indirect_symbol --#define elf_backend_size_dynamic_sections \ -- elf_cris_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ elf_cris_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_finish_dynamic_symbol \ - elf_cris_finish_dynamic_symbol ---- a/bfd/elf32-csky.c -+++ b/bfd/elf32-csky.c -@@ -1893,8 +1893,8 @@ csky_allocate_dynrelocs (struct elf_link - /* Set the sizes of the dynamic sections. */ - - static bool --csky_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+csky_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct csky_elf_link_hash_table *htab; - bfd *dynobj; -@@ -1907,7 +1907,7 @@ csky_elf_size_dynamic_sections (bfd *out - return false; - dynobj = htab->elf.dynobj; - if (dynobj == NULL) -- return false; -+ return true; - - if (htab->elf.dynamic_sections_created) - { -@@ -5344,7 +5344,7 @@ elf32_csky_obj_attrs_handle_unknown (bfd - /* Dynamic relocate related API. */ - #define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections - #define elf_backend_adjust_dynamic_symbol csky_elf_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections csky_elf_size_dynamic_sections -+#define elf_backend_late_size_sections csky_elf_late_size_sections - #define elf_backend_finish_dynamic_symbol csky_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections csky_elf_finish_dynamic_sections - #define elf_backend_rela_normal 1 ---- a/bfd/elf32-frv.c -+++ b/bfd/elf32-frv.c -@@ -5423,15 +5423,16 @@ _frvfdpic_size_got_plt (bfd *output_bfd, - /* Set the sizes of the dynamic sections. */ - - static bool --elf32_frvfdpic_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf32_frvfdpic_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; - struct _frvfdpic_dynamic_got_plt_info gpinfo; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -5472,8 +5473,8 @@ elf32_frvfdpic_size_dynamic_sections (bf - } - - static bool --elf32_frvfdpic_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf32_frvfdpic_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - if (!bfd_link_relocatable (info) - && !bfd_elf_stack_segment_size (output_bfd, info, -@@ -6817,9 +6818,9 @@ elf32_frv_grok_psinfo (bfd *abfd, Elf_In - #undef bfd_elf32_bfd_link_hash_table_create - #define bfd_elf32_bfd_link_hash_table_create \ - frvfdpic_elf_link_hash_table_create --#undef elf_backend_always_size_sections --#define elf_backend_always_size_sections \ -- elf32_frvfdpic_always_size_sections -+#undef elf_backend_early_size_sections -+#define elf_backend_early_size_sections \ -+ elf32_frvfdpic_early_size_sections - - #undef elf_backend_create_dynamic_sections - #define elf_backend_create_dynamic_sections \ -@@ -6827,9 +6828,9 @@ elf32_frv_grok_psinfo (bfd *abfd, Elf_In - #undef elf_backend_adjust_dynamic_symbol - #define elf_backend_adjust_dynamic_symbol \ - elf32_frvfdpic_adjust_dynamic_symbol --#undef elf_backend_size_dynamic_sections --#define elf_backend_size_dynamic_sections \ -- elf32_frvfdpic_size_dynamic_sections -+#undef elf_backend_late_size_sections -+#define elf_backend_late_size_sections \ -+ elf32_frvfdpic_late_size_sections - #undef bfd_elf32_bfd_relax_section - #define bfd_elf32_bfd_relax_section \ - elf32_frvfdpic_relax_section ---- a/bfd/elf32-hppa.c -+++ b/bfd/elf32-hppa.c -@@ -2042,8 +2042,8 @@ clobber_millicode_symbols (struct elf_li - /* Set the sizes of the dynamic sections. */ - - static bool --elf32_hppa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf32_hppa_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf32_hppa_link_hash_table *htab; - bfd *dynobj; -@@ -2057,7 +2057,7 @@ elf32_hppa_size_dynamic_sections (bfd *o - - dynobj = htab->etab.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - if (htab->etab.dynamic_sections_created) - { -@@ -4450,7 +4450,7 @@ elf32_hppa_elf_get_symbol_type (Elf_Inte - #define elf_backend_hide_symbol elf32_hppa_hide_symbol - #define elf_backend_finish_dynamic_symbol elf32_hppa_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections elf32_hppa_finish_dynamic_sections --#define elf_backend_size_dynamic_sections elf32_hppa_size_dynamic_sections -+#define elf_backend_late_size_sections elf32_hppa_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_gc_mark_hook elf32_hppa_gc_mark_hook - #define elf_backend_grok_prstatus elf32_hppa_grok_prstatus ---- a/bfd/elf32-i386.c -+++ b/bfd/elf32-i386.c -@@ -1932,8 +1932,7 @@ elf_i386_scan_relocs (bfd *abfd, - } - - static bool --elf_i386_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf_i386_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - bfd *abfd; - -@@ -1946,7 +1945,7 @@ elf_i386_always_size_sections (bfd *outp - elf_i386_scan_relocs)) - return false; - -- return _bfd_x86_elf_always_size_sections (output_bfd, info); -+ return _bfd_x86_elf_early_size_sections (output_bfd, info); - } - - /* Set the correct type for an x86 ELF section. We do this by the -@@ -4443,7 +4442,7 @@ elf_i386_link_setup_gnu_properties (stru - #define bfd_elf32_get_synthetic_symtab elf_i386_get_synthetic_symtab - - #define elf_backend_relocs_compatible _bfd_elf_relocs_compatible --#define elf_backend_always_size_sections elf_i386_always_size_sections -+#define elf_backend_early_size_sections elf_i386_early_size_sections - #define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections - #define elf_backend_fake_sections elf_i386_fake_sections - #define elf_backend_finish_dynamic_sections elf_i386_finish_dynamic_sections ---- a/bfd/elf32-lm32.c -+++ b/bfd/elf32-lm32.c -@@ -1906,8 +1906,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --lm32_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+lm32_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - struct elf_lm32_link_hash_table *htab; - bfd *dynobj; -@@ -1920,7 +1920,8 @@ lm32_elf_size_dynamic_sections (bfd *out - return false; - - dynobj = htab->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->root.dynamic_sections_created) - { -@@ -2309,7 +2310,7 @@ lm32_elf_create_dynamic_sections (bfd *a - } - - static bool --lm32_elf_always_size_sections (bfd *output_bfd, struct bfd_link_info *info) -+lm32_elf_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - if (!bfd_link_relocatable (info)) - { -@@ -2395,7 +2396,7 @@ lm32_elf_fdpic_copy_private_bfd_data (bf - #define bfd_elf32_bfd_link_hash_table_create lm32_elf_link_hash_table_create - #define elf_backend_check_relocs lm32_elf_check_relocs - #define elf_backend_reloc_type_class lm32_elf_reloc_type_class --#define elf_backend_size_dynamic_sections lm32_elf_size_dynamic_sections -+#define elf_backend_late_size_sections lm32_elf_late_size_sections - #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all - #define elf_backend_create_dynamic_sections lm32_elf_create_dynamic_sections - #define elf_backend_finish_dynamic_sections lm32_elf_finish_dynamic_sections -@@ -2416,8 +2417,8 @@ lm32_elf_fdpic_copy_private_bfd_data (bf - #undef elf32_bed - #define elf32_bed elf32_lm32fdpic_bed - --#undef elf_backend_always_size_sections --#define elf_backend_always_size_sections lm32_elf_always_size_sections -+#undef elf_backend_early_size_sections -+#define elf_backend_early_size_sections lm32_elf_early_size_sections - #undef bfd_elf32_bfd_copy_private_bfd_data - #define bfd_elf32_bfd_copy_private_bfd_data lm32_elf_fdpic_copy_private_bfd_data - ---- a/bfd/elf32-m32c.c -+++ b/bfd/elf32-m32c.c -@@ -773,8 +773,8 @@ m32c_elf_finish_dynamic_sections (bfd *a - } - - static bool --m32c_elf_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+m32c_elf_early_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *splt; -@@ -2131,8 +2131,8 @@ _bfd_m32c_elf_eh_frame_address_size (bfd - #define elf_backend_check_relocs m32c_elf_check_relocs - #define elf_backend_object_p m32c_elf_object_p - #define elf_symbol_leading_char ('_') --#define elf_backend_always_size_sections \ -- m32c_elf_always_size_sections -+#define elf_backend_early_size_sections \ -+ m32c_elf_early_size_sections - #define elf_backend_finish_dynamic_sections \ - m32c_elf_finish_dynamic_sections - ---- a/bfd/elf32-m32r.c -+++ b/bfd/elf32-m32r.c -@@ -1958,8 +1958,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --m32r_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+m32r_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_link_hash_table *htab; - bfd *dynobj; -@@ -1968,7 +1968,7 @@ m32r_elf_size_dynamic_sections (bfd *out - bfd *ibfd; - - #ifdef DEBUG_PIC -- printf ("m32r_elf_size_dynamic_sections()\n"); -+ printf ("m32r_elf_late_size_sections()\n"); - #endif - - htab = m32r_elf_hash_table (info); -@@ -1976,7 +1976,8 @@ m32r_elf_size_dynamic_sections (bfd *out - return false; - - dynobj = htab->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->dynamic_sections_created) - { -@@ -3658,7 +3659,7 @@ m32r_elf_reloc_type_class (const struct - - #define elf_backend_create_dynamic_sections m32r_elf_create_dynamic_sections - #define bfd_elf32_bfd_link_hash_table_create m32r_elf_link_hash_table_create --#define elf_backend_size_dynamic_sections m32r_elf_size_dynamic_sections -+#define elf_backend_late_size_sections m32r_elf_late_size_sections - #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all - #define elf_backend_finish_dynamic_sections m32r_elf_finish_dynamic_sections - #define elf_backend_adjust_dynamic_symbol m32r_elf_adjust_dynamic_symbol ---- a/bfd/elf32-m68k.c -+++ b/bfd/elf32-m68k.c -@@ -2934,7 +2934,7 @@ elf_m68k_get_plt_info (bfd *output_bfd) - It's a convenient place to determine the PLT style. */ - - static bool --elf_m68k_always_size_sections (bfd *output_bfd, struct bfd_link_info *info) -+elf_m68k_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - /* Bind input BFDs to GOTs and calculate sizes of .got and .rela.got - sections. */ -@@ -3107,15 +3107,16 @@ elf_m68k_adjust_dynamic_symbol (struct b - /* Set the sizes of the dynamic sections. */ - - static bool --elf_m68k_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_m68k_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; - bool relocs; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -4628,12 +4629,11 @@ elf_m68k_grok_psinfo (bfd *abfd, Elf_Int - #define bfd_elf32_bfd_final_link bfd_elf_final_link - - #define elf_backend_check_relocs elf_m68k_check_relocs --#define elf_backend_always_size_sections \ -- elf_m68k_always_size_sections -+#define elf_backend_early_size_sections \ -+ elf_m68k_early_size_sections - #define elf_backend_adjust_dynamic_symbol \ - elf_m68k_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections \ -- elf_m68k_size_dynamic_sections -+#define elf_backend_late_size_sections elf_m68k_late_size_sections - #define elf_backend_final_write_processing elf_m68k_final_write_processing - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section elf_m68k_relocate_section ---- a/bfd/elf32-metag.c -+++ b/bfd/elf32-metag.c -@@ -2717,8 +2717,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --elf_metag_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_metag_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_metag_link_hash_table *htab; - bfd *dynobj; -@@ -2729,7 +2729,7 @@ elf_metag_size_dynamic_sections (bfd *ou - htab = metag_link_hash_table (info); - dynobj = htab->etab.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - if (htab->etab.dynamic_sections_created) - { -@@ -4019,7 +4019,7 @@ elf_metag_plt_sym_val (bfd_vma i, const - #define elf_backend_adjust_dynamic_symbol elf_metag_adjust_dynamic_symbol - #define elf_backend_finish_dynamic_symbol elf_metag_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections elf_metag_finish_dynamic_sections --#define elf_backend_size_dynamic_sections elf_metag_size_dynamic_sections -+#define elf_backend_late_size_sections elf_metag_late_size_sections - #define elf_backend_omit_section_dynsym \ - _bfd_elf_omit_section_dynsym_all - #define elf_backend_init_file_header elf_metag_init_file_header ---- a/bfd/elf32-microblaze.c -+++ b/bfd/elf32-microblaze.c -@@ -2946,8 +2946,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --microblaze_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+microblaze_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf32_mb_link_hash_table *htab; - bfd *dynobj; -@@ -2959,7 +2959,8 @@ microblaze_elf_size_dynamic_sections (bf - return false; - - dynobj = htab->elf.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - /* Set up .got offsets for local syms, and space for local dynamic - relocs. */ -@@ -3477,7 +3478,7 @@ microblaze_elf_add_symbol_hook (bfd *abf - #define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections - #define elf_backend_finish_dynamic_sections microblaze_elf_finish_dynamic_sections - #define elf_backend_finish_dynamic_symbol microblaze_elf_finish_dynamic_symbol --#define elf_backend_size_dynamic_sections microblaze_elf_size_dynamic_sections -+#define elf_backend_late_size_sections microblaze_elf_late_size_sections - #define elf_backend_add_symbol_hook microblaze_elf_add_symbol_hook - - #include "elf32-target.h" ---- a/bfd/elf32-mips.c -+++ b/bfd/elf32-mips.c -@@ -2525,10 +2525,8 @@ static const struct ecoff_debug_swap mip - #define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mips_elf_adjust_dynamic_symbol --#define elf_backend_always_size_sections \ -- _bfd_mips_elf_always_size_sections --#define elf_backend_size_dynamic_sections \ -- _bfd_mips_elf_size_dynamic_sections -+#define elf_backend_early_size_sections _bfd_mips_elf_early_size_sections -+#define elf_backend_late_size_sections _bfd_mips_elf_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section _bfd_mips_elf_relocate_section - #define elf_backend_finish_dynamic_symbol \ ---- a/bfd/elf32-nds32.c -+++ b/bfd/elf32-nds32.c -@@ -4302,8 +4302,8 @@ elf32_nds32_add_dynreloc (bfd *output_bf - /* Set the sizes of the dynamic sections. */ - - static bool --nds32_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+nds32_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_nds32_link_hash_table *htab; - bfd *dynobj; -@@ -4316,7 +4316,8 @@ nds32_elf_size_dynamic_sections (bfd *ou - return false; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -13984,7 +13985,7 @@ nds32_elf_unify_tls_model (bfd *inbfd, a - #define elf_backend_create_dynamic_sections nds32_elf_create_dynamic_sections - #define elf_backend_finish_dynamic_sections nds32_elf_finish_dynamic_sections - #define elf_backend_finish_dynamic_symbol nds32_elf_finish_dynamic_symbol --#define elf_backend_size_dynamic_sections nds32_elf_size_dynamic_sections -+#define elf_backend_late_size_sections nds32_elf_late_size_sections - #define elf_backend_relocate_section nds32_elf_relocate_section - #define elf_backend_gc_mark_hook nds32_elf_gc_mark_hook - #define elf_backend_grok_prstatus nds32_elf_grok_prstatus ---- a/bfd/elf32-nios2.c -+++ b/bfd/elf32-nios2.c -@@ -5411,7 +5411,7 @@ nios2_elf32_adjust_dynamic_symbol (struc - return true; - } - --/* Worker function for nios2_elf32_size_dynamic_sections. */ -+/* Worker function for nios2_elf32_late_size_sections. */ - static bool - adjust_dynrelocs (struct elf_link_hash_entry *h, void *inf) - { -@@ -5438,7 +5438,7 @@ adjust_dynrelocs (struct elf_link_hash_e - return true; - } - --/* Another worker function for nios2_elf32_size_dynamic_sections. -+/* Another worker function for nios2_elf32_late_size_sections. - Allocate space in .plt, .got and associated reloc sections for - dynamic relocs. */ - static bool -@@ -5673,11 +5673,11 @@ allocate_dynrelocs (struct elf_link_hash - return true; - } - --/* Implement elf_backend_size_dynamic_sections: -+/* Implement elf_backend_late_size_sections: - Set the sizes of the dynamic sections. */ - static bool --nios2_elf32_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+nios2_elf32_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; -@@ -5687,7 +5687,8 @@ nios2_elf32_size_dynamic_sections (bfd * - - htab = elf32_nios2_hash_table (info); - dynobj = htab->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - htab->res_n_size = 0; - if (htab->root.dynamic_sections_created) -@@ -6058,7 +6059,7 @@ const struct bfd_elf_special_section elf - nios2_elf32_finish_dynamic_sections - #define elf_backend_adjust_dynamic_symbol nios2_elf32_adjust_dynamic_symbol - #define elf_backend_reloc_type_class nios2_elf32_reloc_type_class --#define elf_backend_size_dynamic_sections nios2_elf32_size_dynamic_sections -+#define elf_backend_late_size_sections nios2_elf32_late_size_sections - #define elf_backend_add_symbol_hook nios2_elf_add_symbol_hook - #define elf_backend_copy_indirect_symbol nios2_elf32_copy_indirect_symbol - #define elf_backend_object_p nios2_elf32_object_p ---- a/bfd/elf32-or1k.c -+++ b/bfd/elf32-or1k.c -@@ -3039,8 +3039,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --or1k_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+or1k_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_or1k_link_hash_table *htab; - bfd *dynobj; -@@ -3053,7 +3053,8 @@ or1k_elf_size_dynamic_sections (bfd *out - return false; - - dynobj = htab->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->root.dynamic_sections_created) - { -@@ -3406,7 +3407,7 @@ or1k_grok_psinfo (bfd *abfd, Elf_Interna - #define elf_backend_copy_indirect_symbol or1k_elf_copy_indirect_symbol - #define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections - #define elf_backend_finish_dynamic_sections or1k_elf_finish_dynamic_sections --#define elf_backend_size_dynamic_sections or1k_elf_size_dynamic_sections -+#define elf_backend_late_size_sections or1k_elf_late_size_sections - #define elf_backend_adjust_dynamic_symbol or1k_elf_adjust_dynamic_symbol - #define elf_backend_finish_dynamic_symbol or1k_elf_finish_dynamic_symbol - ---- a/bfd/elf32-ppc.c -+++ b/bfd/elf32-ppc.c -@@ -5477,8 +5477,8 @@ static const unsigned char glink_eh_fram - /* Set the sizes of the dynamic sections. */ - - static bool --ppc_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+ppc_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - struct ppc_elf_link_hash_table *htab; - asection *s; -@@ -5486,11 +5486,12 @@ ppc_elf_size_dynamic_sections (bfd *outp - bfd *ibfd; - - #ifdef DEBUG -- fprintf (stderr, "ppc_elf_size_dynamic_sections called\n"); -+ fprintf (stderr, "ppc_elf_late_size_sections called\n"); - #endif - - htab = ppc_elf_hash_table (info); -- BFD_ASSERT (htab->elf.dynobj != NULL); -+ if (htab->elf.dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -10414,7 +10415,7 @@ ppc_elf_finish_dynamic_sections (bfd *ou - #define elf_backend_copy_indirect_symbol ppc_elf_copy_indirect_symbol - #define elf_backend_adjust_dynamic_symbol ppc_elf_adjust_dynamic_symbol - #define elf_backend_add_symbol_hook ppc_elf_add_symbol_hook --#define elf_backend_size_dynamic_sections ppc_elf_size_dynamic_sections -+#define elf_backend_late_size_sections ppc_elf_late_size_sections - #define elf_backend_hash_symbol ppc_elf_hash_symbol - #define elf_backend_finish_dynamic_symbol ppc_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections ppc_elf_finish_dynamic_sections ---- a/bfd/elf32-rl78.c -+++ b/bfd/elf32-rl78.c -@@ -1440,8 +1440,8 @@ rl78_elf_finish_dynamic_sections (bfd *a - } - - static bool --rl78_elf_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+rl78_elf_early_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *splt; -@@ -2609,8 +2609,8 @@ rl78_elf_relax_section (bfd *abfd, - - #define bfd_elf32_bfd_relax_section rl78_elf_relax_section - #define elf_backend_check_relocs rl78_elf_check_relocs --#define elf_backend_always_size_sections \ -- rl78_elf_always_size_sections -+#define elf_backend_early_size_sections \ -+ rl78_elf_early_size_sections - #define elf_backend_finish_dynamic_sections \ - rl78_elf_finish_dynamic_sections - ---- a/bfd/elf32-s390.c -+++ b/bfd/elf32-s390.c -@@ -1366,7 +1366,7 @@ elf_s390_gc_mark_hook (asection *sec, - entry but we found we will not create any. Called when we find we will - not have any PLT for this symbol, by for example - elf_s390_adjust_dynamic_symbol when we're doing a proper dynamic link, -- or elf_s390_size_dynamic_sections if no dynamic sections will be -+ or elf_s390_late_size_sections if no dynamic sections will be - created (we're only linking static objects). */ - - static void -@@ -1778,8 +1778,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --elf_s390_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_s390_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_s390_link_hash_table *htab; - bfd *dynobj; -@@ -1790,7 +1790,7 @@ elf_s390_size_dynamic_sections (bfd *out - htab = elf_s390_hash_table (info); - dynobj = htab->elf.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - if (htab->elf.dynamic_sections_created) - { -@@ -3926,7 +3926,7 @@ elf32_s390_merge_private_bfd_data (bfd * - #define elf_backend_gc_mark_hook elf_s390_gc_mark_hook - #define elf_backend_reloc_type_class elf_s390_reloc_type_class - #define elf_backend_relocate_section elf_s390_relocate_section --#define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections -+#define elf_backend_late_size_sections elf_s390_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_grok_prstatus elf_s390_grok_prstatus - #define elf_backend_grok_psinfo elf_s390_grok_psinfo ---- a/bfd/elf32-score.c -+++ b/bfd/elf32-score.c -@@ -1089,7 +1089,7 @@ score_elf_got_info (bfd *abfd, asection - appear towards the end. This reduces the amount of GOT space - required. MAX_LOCAL is used to set the number of local symbols - known to be in the dynamic symbol table. During -- s3_bfd_score_elf_size_dynamic_sections, this value is 1. Afterward, the -+ s3_bfd_score_elf_late_size_sections, this value is 1. Afterward, the - section symbols are added and the count is higher. */ - static bool - score_elf_sort_hash_table (struct bfd_link_info *info, -@@ -3160,8 +3160,8 @@ s3_bfd_score_elf_adjust_dynamic_symbol ( - /* This function is called after all the input files have been read, - and the input sections have been assigned to output sections. */ - static bool --s3_bfd_score_elf_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+s3_bfd_score_elf_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; -@@ -3237,14 +3237,15 @@ s3_bfd_score_elf_always_size_sections (b - - /* Set the sizes of the dynamic sections. */ - static bool --s3_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+s3_bfd_score_elf_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; - bool reltext; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -3313,7 +3314,7 @@ s3_bfd_score_elf_size_dynamic_sections ( - } - else if (startswith (name, ".got")) - { -- /* s3_bfd_score_elf_always_size_sections() has already done -+ /* s3_bfd_score_elf_early_size_sections() has already done - most of the work, but some symbols may have been mapped - to versions that we must now resolve in the got_entries - hash tables. */ -@@ -4177,22 +4178,22 @@ _bfd_score_elf_adjust_dynamic_symbol (st - } - - static bool --_bfd_score_elf_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+_bfd_score_elf_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - if (bfd_get_mach (output_bfd) == bfd_mach_score3) -- return s3_bfd_score_elf_always_size_sections (output_bfd, info); -+ return s3_bfd_score_elf_early_size_sections (output_bfd, info); - else -- return s7_bfd_score_elf_always_size_sections (output_bfd, info); -+ return s7_bfd_score_elf_early_size_sections (output_bfd, info); - } - - static bool --_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+_bfd_score_elf_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - if (bfd_get_mach (output_bfd) == bfd_mach_score3) -- return s3_bfd_score_elf_size_dynamic_sections (output_bfd, info); -+ return s3_bfd_score_elf_late_size_sections (output_bfd, info); - else -- return s7_bfd_score_elf_size_dynamic_sections (output_bfd, info); -+ return s7_bfd_score_elf_late_size_sections (output_bfd, info); - } - - static bool -@@ -4455,10 +4456,10 @@ _bfd_score_elf_common_definition (Elf_In - _bfd_score_elf_section_from_bfd_section - #define elf_backend_adjust_dynamic_symbol \ - _bfd_score_elf_adjust_dynamic_symbol --#define elf_backend_always_size_sections \ -- _bfd_score_elf_always_size_sections --#define elf_backend_size_dynamic_sections \ -- _bfd_score_elf_size_dynamic_sections -+#define elf_backend_early_size_sections \ -+ _bfd_score_elf_early_size_sections -+#define elf_backend_late_size_sections \ -+ _bfd_score_elf_late_size_sections - #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all - #define elf_backend_create_dynamic_sections \ - _bfd_score_elf_create_dynamic_sections ---- a/bfd/elf32-score.h -+++ b/bfd/elf32-score.h -@@ -78,10 +78,10 @@ s7_bfd_score_elf_adjust_dynamic_symbol ( - struct elf_link_hash_entry *); - - extern bool --s7_bfd_score_elf_always_size_sections (bfd *, struct bfd_link_info *); -+s7_bfd_score_elf_early_size_sections (bfd *, struct bfd_link_info *); - - extern bool --s7_bfd_score_elf_size_dynamic_sections (bfd *, struct bfd_link_info *); -+s7_bfd_score_elf_late_size_sections (bfd *, struct bfd_link_info *); - - extern bool - s7_bfd_score_elf_create_dynamic_sections (bfd *, struct bfd_link_info *); ---- a/bfd/elf32-score7.c -+++ b/bfd/elf32-score7.c -@@ -975,7 +975,7 @@ score_elf_got_info (bfd *abfd, asection - appear towards the end. This reduces the amount of GOT space - required. MAX_LOCAL is used to set the number of local symbols - known to be in the dynamic symbol table. During -- s7_bfd_score_elf_size_dynamic_sections, this value is 1. Afterward, the -+ s7_bfd_score_elf_late_size_sections, this value is 1. Afterward, the - section symbols are added and the count is higher. */ - - static bool -@@ -2969,8 +2969,8 @@ s7_bfd_score_elf_adjust_dynamic_symbol ( - and the input sections have been assigned to output sections. */ - - bool --s7_bfd_score_elf_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+s7_bfd_score_elf_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; -@@ -3047,14 +3047,15 @@ s7_bfd_score_elf_always_size_sections (b - /* Set the sizes of the dynamic sections. */ - - bool --s7_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+s7_bfd_score_elf_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; - bool reltext; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -3123,7 +3124,7 @@ s7_bfd_score_elf_size_dynamic_sections ( - } - else if (startswith (name, ".got")) - { -- /* s7_bfd_score_elf_always_size_sections() has already done -+ /* s7_bfd_score_elf_early_size_sections() has already done - most of the work, but some symbols may have been mapped - to versions that we must now resolve in the got_entries - hash tables. */ ---- a/bfd/elf32-sh.c -+++ b/bfd/elf32-sh.c -@@ -2925,7 +2925,7 @@ allocate_dynrelocs (struct elf_link_hash - It's a convenient place to determine the PLT style. */ - - static bool --sh_elf_always_size_sections (bfd *output_bfd, struct bfd_link_info *info) -+sh_elf_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - sh_elf_hash_table (info)->plt_info = get_plt_info (output_bfd, - bfd_link_pic (info)); -@@ -2940,8 +2940,8 @@ sh_elf_always_size_sections (bfd *output - /* Set the sizes of the dynamic sections. */ - - static bool --sh_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+sh_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_sh_link_hash_table *htab; - bfd *dynobj; -@@ -2954,7 +2954,8 @@ sh_elf_size_dynamic_sections (bfd *outpu - return false; - - dynobj = htab->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->root.dynamic_sections_created) - { -@@ -6589,10 +6590,8 @@ sh_elf_encode_eh_address (bfd *abfd, - sh_elf_link_hash_table_create - #define elf_backend_adjust_dynamic_symbol \ - sh_elf_adjust_dynamic_symbol --#define elf_backend_always_size_sections \ -- sh_elf_always_size_sections --#define elf_backend_size_dynamic_sections \ -- sh_elf_size_dynamic_sections -+#define elf_backend_early_size_sections sh_elf_early_size_sections -+#define elf_backend_late_size_sections sh_elf_late_size_sections - #define elf_backend_omit_section_dynsym sh_elf_omit_section_dynsym - #define elf_backend_finish_dynamic_symbol \ - sh_elf_finish_dynamic_symbol ---- a/bfd/elf32-sparc.c -+++ b/bfd/elf32-sparc.c -@@ -248,8 +248,7 @@ elf32_sparc_reloc_type_class (const stru - #define elf_backend_adjust_dynamic_symbol \ - _bfd_sparc_elf_adjust_dynamic_symbol - #define elf_backend_omit_section_dynsym _bfd_sparc_elf_omit_section_dynsym --#define elf_backend_size_dynamic_sections \ -- _bfd_sparc_elf_size_dynamic_sections -+#define elf_backend_late_size_sections _bfd_sparc_elf_late_size_sections - #define elf_backend_relocate_section _bfd_sparc_elf_relocate_section - #define elf_backend_finish_dynamic_symbol \ - _bfd_sparc_elf_finish_dynamic_symbol ---- a/bfd/elf32-tic6x.c -+++ b/bfd/elf32-tic6x.c -@@ -3160,7 +3160,7 @@ elf32_tic6x_allocate_dynrelocs (struct e - /* Set the sizes of the dynamic sections. */ - - static bool --elf32_tic6x_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+elf32_tic6x_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - struct elf32_tic6x_link_hash_table *htab; - bfd *dynobj; -@@ -3171,7 +3171,7 @@ elf32_tic6x_size_dynamic_sections (bfd * - htab = elf32_tic6x_hash_table (info); - dynobj = htab->elf.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - if (htab->elf.dynamic_sections_created) - { -@@ -3358,7 +3358,7 @@ elf32_tic6x_size_dynamic_sections (bfd * - and the input sections have been assigned to output sections. */ - - static bool --elf32_tic6x_always_size_sections (bfd *output_bfd, struct bfd_link_info *info) -+elf32_tic6x_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - if (elf32_tic6x_using_dsbt (output_bfd) && !bfd_link_relocatable (info) - && !bfd_elf_stack_segment_size (output_bfd, info, -@@ -4261,10 +4261,10 @@ elf32_tic6x_write_section (bfd *output_b - #define elf_backend_relocs_compatible _bfd_elf_relocs_compatible - #define elf_backend_finish_dynamic_symbol \ - elf32_tic6x_finish_dynamic_symbol --#define elf_backend_always_size_sections \ -- elf32_tic6x_always_size_sections --#define elf_backend_size_dynamic_sections \ -- elf32_tic6x_size_dynamic_sections -+#define elf_backend_early_size_sections \ -+ elf32_tic6x_early_size_sections -+#define elf_backend_late_size_sections \ -+ elf32_tic6x_late_size_sections - #define elf_backend_finish_dynamic_sections \ - elf32_tic6x_finish_dynamic_sections - #define bfd_elf32_bfd_final_link \ ---- a/bfd/elf32-tilegx.c -+++ b/bfd/elf32-tilegx.c -@@ -105,7 +105,7 @@ tilegx_elf_grok_psinfo (bfd *abfd, Elf_I - #define elf_backend_check_relocs tilegx_elf_check_relocs - #define elf_backend_adjust_dynamic_symbol tilegx_elf_adjust_dynamic_symbol - #define elf_backend_omit_section_dynsym tilegx_elf_omit_section_dynsym --#define elf_backend_size_dynamic_sections tilegx_elf_size_dynamic_sections -+#define elf_backend_late_size_sections tilegx_elf_late_size_sections - #define elf_backend_relocate_section tilegx_elf_relocate_section - #define elf_backend_finish_dynamic_symbol tilegx_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections tilegx_elf_finish_dynamic_sections ---- a/bfd/elf32-tilepro.c -+++ b/bfd/elf32-tilepro.c -@@ -2182,11 +2182,9 @@ tilepro_elf_omit_section_dynsym (bfd *ou - #define ELF32_DYNAMIC_INTERPRETER "/lib/ld.so.1" - - static bool --tilepro_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+tilepro_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { -- (void)output_bfd; -- - struct elf_link_hash_table *htab; - bfd *dynobj; - asection *s; -@@ -2195,7 +2193,8 @@ tilepro_elf_size_dynamic_sections (bfd * - htab = tilepro_elf_hash_table (info); - BFD_ASSERT (htab != NULL); - dynobj = htab->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -3739,7 +3738,7 @@ tilepro_additional_program_headers (bfd - #define elf_backend_check_relocs tilepro_elf_check_relocs - #define elf_backend_adjust_dynamic_symbol tilepro_elf_adjust_dynamic_symbol - #define elf_backend_omit_section_dynsym tilepro_elf_omit_section_dynsym --#define elf_backend_size_dynamic_sections tilepro_elf_size_dynamic_sections -+#define elf_backend_late_size_sections tilepro_elf_late_size_sections - #define elf_backend_relocate_section tilepro_elf_relocate_section - #define elf_backend_finish_dynamic_symbol tilepro_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections tilepro_elf_finish_dynamic_sections ---- a/bfd/elf32-vax.c -+++ b/bfd/elf32-vax.c -@@ -36,7 +36,6 @@ static bool elf_vax_check_relocs (bfd *, - asection *, const Elf_Internal_Rela *); - static bool elf_vax_adjust_dynamic_symbol (struct bfd_link_info *, - struct elf_link_hash_entry *); --static bool elf_vax_size_dynamic_sections (bfd *, struct bfd_link_info *); - static int elf_vax_relocate_section (bfd *, struct bfd_link_info *, - bfd *, asection *, bfd_byte *, - Elf_Internal_Rela *, -@@ -985,8 +984,8 @@ elf_vax_discard_got_entries (struct elf_ - /* Discard unused dynamic data if this is a static link. */ - - static bool --elf_vax_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_vax_early_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; -@@ -1024,14 +1023,15 @@ elf_vax_always_size_sections (bfd *outpu - /* Set the sizes of the dynamic sections. */ - - static bool --elf_vax_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+elf_vax_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; - bool relocs; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -1861,10 +1861,8 @@ elf_vax_plt_sym_val (bfd_vma i, const as - #define elf_backend_check_relocs elf_vax_check_relocs - #define elf_backend_adjust_dynamic_symbol \ - elf_vax_adjust_dynamic_symbol --#define elf_backend_always_size_sections \ -- elf_vax_always_size_sections --#define elf_backend_size_dynamic_sections \ -- elf_vax_size_dynamic_sections -+#define elf_backend_early_size_sections elf_vax_early_size_sections -+#define elf_backend_late_size_sections elf_vax_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section elf_vax_relocate_section - #define elf_backend_finish_dynamic_symbol \ ---- a/bfd/elf32-xstormy16.c -+++ b/bfd/elf32-xstormy16.c -@@ -706,8 +706,8 @@ xstormy16_elf_relax_section (bfd *dynobj - } - - static bool --xstormy16_elf_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+xstormy16_elf_early_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *splt; -@@ -1013,8 +1013,8 @@ xstormy16_elf_gc_mark_hook (asection *se - #define elf_backend_relocate_section xstormy16_elf_relocate_section - #define elf_backend_gc_mark_hook xstormy16_elf_gc_mark_hook - #define elf_backend_check_relocs xstormy16_elf_check_relocs --#define elf_backend_always_size_sections \ -- xstormy16_elf_always_size_sections -+#define elf_backend_early_size_sections \ -+ xstormy16_elf_early_size_sections - #define elf_backend_omit_section_dynsym \ - _bfd_elf_omit_section_dynsym_all - #define elf_backend_finish_dynamic_sections \ ---- a/bfd/elf32-xtensa.c -+++ b/bfd/elf32-xtensa.c -@@ -1568,8 +1568,8 @@ elf_xtensa_allocate_local_got_size (stru - /* Set the sizes of the dynamic sections. */ - - static bool --elf_xtensa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_xtensa_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_xtensa_link_hash_table *htab; - bfd *dynobj, *abfd; -@@ -1586,7 +1586,7 @@ elf_xtensa_size_dynamic_sections (bfd *o - - dynobj = elf_hash_table (info)->dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - srelgot = htab->elf.srelgot; - srelplt = htab->elf.srelplt; - -@@ -1791,8 +1791,7 @@ elf_xtensa_size_dynamic_sections (bfd *o - } - - static bool --elf_xtensa_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf_xtensa_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - struct elf_xtensa_link_hash_table *htab; - asection *tls_sec; -@@ -11551,8 +11550,8 @@ static const struct bfd_elf_special_sect - #define elf_backend_object_p elf_xtensa_object_p - #define elf_backend_reloc_type_class elf_xtensa_reloc_type_class - #define elf_backend_relocate_section elf_xtensa_relocate_section --#define elf_backend_size_dynamic_sections elf_xtensa_size_dynamic_sections --#define elf_backend_always_size_sections elf_xtensa_always_size_sections -+#define elf_backend_late_size_sections elf_xtensa_late_size_sections -+#define elf_backend_early_size_sections elf_xtensa_early_size_sections - #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all - #define elf_backend_special_sections elf_xtensa_special_sections - #define elf_backend_action_discarded elf_xtensa_action_discarded ---- a/bfd/elf64-alpha.c -+++ b/bfd/elf64-alpha.c -@@ -2579,8 +2579,8 @@ elf64_alpha_size_plt_section (struct bfd - } - - static bool --elf64_alpha_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf64_alpha_early_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *i; - struct alpha_elf_link_hash_table * htab; -@@ -2806,8 +2806,8 @@ elf64_alpha_size_rela_got_section (struc - /* Set the sizes of the dynamic sections. */ - - static bool --elf64_alpha_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf64_alpha_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; -@@ -2819,7 +2819,8 @@ elf64_alpha_size_dynamic_sections (bfd * - return false; - - dynobj = elf_hash_table(info)->dynobj; -- BFD_ASSERT(dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -5465,10 +5466,10 @@ static const struct elf_size_info alpha_ - elf64_alpha_merge_symbol_attribute - #define elf_backend_copy_indirect_symbol \ - elf64_alpha_copy_indirect_symbol --#define elf_backend_always_size_sections \ -- elf64_alpha_always_size_sections --#define elf_backend_size_dynamic_sections \ -- elf64_alpha_size_dynamic_sections -+#define elf_backend_early_size_sections \ -+ elf64_alpha_early_size_sections -+#define elf_backend_late_size_sections \ -+ elf64_alpha_late_size_sections - #define elf_backend_omit_section_dynsym \ - _bfd_elf_omit_section_dynsym_all - #define elf_backend_relocate_section \ ---- a/bfd/elf64-hppa.c -+++ b/bfd/elf64-hppa.c -@@ -176,9 +176,6 @@ static bool elf64_hppa_adjust_dynamic_sy - static bool elf64_hppa_mark_milli_and_exported_functions - (struct elf_link_hash_entry *, void *); - --static bool elf64_hppa_size_dynamic_sections -- (bfd *, struct bfd_link_info *); -- - static int elf64_hppa_link_output_symbol_hook - (struct bfd_link_info *, const char *, Elf_Internal_Sym *, - asection *, struct elf_link_hash_entry *); -@@ -1520,7 +1517,7 @@ elf64_hppa_mark_milli_and_exported_funct - the contents of our special sections. */ - - static bool --elf64_hppa_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+elf64_hppa_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - struct elf64_hppa_link_hash_table *hppa_info; - struct elf64_hppa_allocate_data data; -@@ -1534,7 +1531,8 @@ elf64_hppa_size_dynamic_sections (bfd *o - return false; - - dynobj = hppa_info->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - /* Mark each function this program exports so that we will allocate - space in the .opd section for each function's FPTR. If we are -@@ -3984,8 +3982,7 @@ const struct elf_size_info hppa64_elf_si - #define elf_backend_adjust_dynamic_symbol \ - elf64_hppa_adjust_dynamic_symbol - --#define elf_backend_size_dynamic_sections \ -- elf64_hppa_size_dynamic_sections -+#define elf_backend_late_size_sections elf64_hppa_late_size_sections - - #define elf_backend_finish_dynamic_symbol \ - elf64_hppa_finish_dynamic_symbol ---- a/bfd/elf64-ia64-vms.c -+++ b/bfd/elf64-ia64-vms.c -@@ -2590,8 +2590,8 @@ elf64_ia64_adjust_dynamic_symbol (struct - } - - static bool --elf64_ia64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf64_ia64_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf64_ia64_allocate_data data; - struct elf64_ia64_link_hash_table *ia64_info; -@@ -2600,11 +2600,12 @@ elf64_ia64_size_dynamic_sections (bfd *o - struct elf_link_hash_table *hash_table; - - hash_table = elf_hash_table (info); -- dynobj = hash_table->dynobj; - ia64_info = elf64_ia64_hash_table (info); - if (ia64_info == NULL) - return false; -- BFD_ASSERT(dynobj != NULL); -+ dynobj = hash_table->dynobj; -+ if (dynobj == NULL) -+ return true; - data.info = info; - - /* Allocate the GOT entries. */ -@@ -5484,8 +5485,8 @@ static const struct elf_size_info elf64_ - elf64_ia64_check_relocs - #define elf_backend_adjust_dynamic_symbol \ - elf64_ia64_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections \ -- elf64_ia64_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ elf64_ia64_late_size_sections - #define elf_backend_omit_section_dynsym \ - _bfd_elf_omit_section_dynsym_all - #define elf_backend_relocate_section \ ---- a/bfd/elf64-mips.c -+++ b/bfd/elf64-mips.c -@@ -4739,10 +4739,10 @@ const struct elf_size_info mips_elf64_si - #define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mips_elf_adjust_dynamic_symbol --#define elf_backend_always_size_sections \ -- _bfd_mips_elf_always_size_sections --#define elf_backend_size_dynamic_sections \ -- _bfd_mips_elf_size_dynamic_sections -+#define elf_backend_early_size_sections \ -+ _bfd_mips_elf_early_size_sections -+#define elf_backend_late_size_sections \ -+ _bfd_mips_elf_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section _bfd_mips_elf_relocate_section - #define elf_backend_finish_dynamic_symbol \ ---- a/bfd/elf64-ppc.c -+++ b/bfd/elf64-ppc.c -@@ -118,8 +118,8 @@ static bfd_vma opd_entry_value - #define elf_backend_adjust_dynamic_symbol ppc64_elf_adjust_dynamic_symbol - #define elf_backend_hide_symbol ppc64_elf_hide_symbol - #define elf_backend_maybe_function_sym ppc64_elf_maybe_function_sym --#define elf_backend_always_size_sections ppc64_elf_edit --#define elf_backend_size_dynamic_sections ppc64_elf_size_dynamic_sections -+#define elf_backend_early_size_sections ppc64_elf_edit -+#define elf_backend_late_size_sections ppc64_elf_late_size_sections - #define elf_backend_hash_symbol ppc64_elf_hash_symbol - #define elf_backend_init_index_section _bfd_elf_init_2_index_sections - #define elf_backend_action_discarded ppc64_elf_action_discarded -@@ -10117,7 +10117,7 @@ allocate_dynrelocs (struct elf_link_hash - ((((v) & 0x3ffff0000ULL) << 16) | (v & 0xffff)) - #define HA34(v) ((v + (1ULL << 33)) >> 34) - --/* Called via elf_link_hash_traverse from ppc64_elf_size_dynamic_sections -+/* Called via elf_link_hash_traverse from ppc64_elf_late_size_sections - to set up space for global entry stubs. These are put in glink, - after the branch table. */ - -@@ -10194,8 +10194,8 @@ size_global_entry_stubs (struct elf_link - /* Set the sizes of the dynamic sections. */ - - static bool --ppc64_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+ppc64_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - struct ppc_link_hash_table *htab; - bfd *dynobj; -@@ -10210,7 +10210,7 @@ ppc64_elf_size_dynamic_sections (bfd *ou - - dynobj = htab->elf.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - if (htab->elf.dynamic_sections_created) - { ---- a/bfd/elf64-s390.c -+++ b/bfd/elf64-s390.c -@@ -1301,7 +1301,7 @@ elf_s390_gc_mark_hook (asection *sec, - entry but we found we will not create any. Called when we find we will - not have any PLT for this symbol, by for example - elf_s390_adjust_dynamic_symbol when we're doing a proper dynamic link, -- or elf_s390_size_dynamic_sections if no dynamic sections will be -+ or elf_s390_late_size_sections if no dynamic sections will be - created (we're only linking static objects). */ - - static void -@@ -1714,8 +1714,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --elf_s390_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_s390_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_s390_link_hash_table *htab; - bfd *dynobj; -@@ -1729,7 +1729,7 @@ elf_s390_size_dynamic_sections (bfd *out - - dynobj = htab->elf.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - if (htab->elf.dynamic_sections_created) - { -@@ -3894,7 +3894,7 @@ const struct elf_size_info s390_elf64_si - #define elf_backend_gc_mark_hook elf_s390_gc_mark_hook - #define elf_backend_reloc_type_class elf_s390_reloc_type_class - #define elf_backend_relocate_section elf_s390_relocate_section --#define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections -+#define elf_backend_late_size_sections elf_s390_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_grok_prstatus elf_s390_grok_prstatus - #define elf_backend_grok_psinfo elf_s390_grok_psinfo ---- a/bfd/elf64-sparc.c -+++ b/bfd/elf64-sparc.c -@@ -938,8 +938,8 @@ const struct elf_size_info elf64_sparc_s - _bfd_sparc_elf_adjust_dynamic_symbol - #define elf_backend_omit_section_dynsym \ - _bfd_sparc_elf_omit_section_dynsym --#define elf_backend_size_dynamic_sections \ -- _bfd_sparc_elf_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ _bfd_sparc_elf_late_size_sections - #define elf_backend_relocate_section \ - _bfd_sparc_elf_relocate_section - #define elf_backend_finish_dynamic_symbol \ ---- a/bfd/elf64-tilegx.c -+++ b/bfd/elf64-tilegx.c -@@ -106,7 +106,7 @@ tilegx_elf_grok_psinfo (bfd *abfd, Elf_I - #define elf_backend_check_relocs tilegx_elf_check_relocs - #define elf_backend_adjust_dynamic_symbol tilegx_elf_adjust_dynamic_symbol - #define elf_backend_omit_section_dynsym tilegx_elf_omit_section_dynsym --#define elf_backend_size_dynamic_sections tilegx_elf_size_dynamic_sections -+#define elf_backend_late_size_sections tilegx_elf_late_size_sections - #define elf_backend_relocate_section tilegx_elf_relocate_section - #define elf_backend_finish_dynamic_symbol tilegx_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections tilegx_elf_finish_dynamic_sections ---- a/bfd/elf64-x86-64.c -+++ b/bfd/elf64-x86-64.c -@@ -2377,8 +2377,7 @@ elf_x86_64_scan_relocs (bfd *abfd, struc - } - - static bool --elf_x86_64_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf_x86_64_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - bfd *abfd; - -@@ -2391,7 +2390,7 @@ elf_x86_64_always_size_sections (bfd *ou - elf_x86_64_scan_relocs)) - return false; - -- return _bfd_x86_elf_always_size_sections (output_bfd, info); -+ return _bfd_x86_elf_early_size_sections (output_bfd, info); - } - - /* Return the relocation value for @tpoff relocation -@@ -5284,7 +5283,7 @@ elf_x86_64_special_sections[]= - elf_x86_64_reloc_name_lookup - - #define elf_backend_relocs_compatible elf_x86_64_relocs_compatible --#define elf_backend_always_size_sections elf_x86_64_always_size_sections -+#define elf_backend_early_size_sections elf_x86_64_early_size_sections - #define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections - #define elf_backend_finish_dynamic_sections elf_x86_64_finish_dynamic_sections - #define elf_backend_finish_dynamic_symbol elf_x86_64_finish_dynamic_symbol ---- a/bfd/elflink.c -+++ b/bfd/elflink.c -@@ -6619,8 +6619,8 @@ bfd_elf_size_dynamic_sections (bfd *outp - - /* The backend may have to create some sections regardless of whether - we're dynamic or not. */ -- if (bed->elf_backend_always_size_sections -- && ! (*bed->elf_backend_always_size_sections) (output_bfd, info)) -+ if (bed->elf_backend_early_size_sections -+ && !bed->elf_backend_early_size_sections (output_bfd, info)) - return false; - - dynobj = elf_hash_table (info)->dynobj; -@@ -7400,9 +7400,8 @@ NOTE: This behaviour is deprecated and w - - /* The backend must work out the sizes of all the other dynamic - sections. */ -- if (dynobj != NULL -- && bed->elf_backend_size_dynamic_sections != NULL -- && ! (*bed->elf_backend_size_dynamic_sections) (output_bfd, info)) -+ if (bed->elf_backend_late_size_sections != NULL -+ && !bed->elf_backend_late_size_sections (output_bfd, info)) - return false; - - if (dynobj != NULL && elf_hash_table (info)->dynamic_sections_created) ---- a/bfd/elfn32-mips.c -+++ b/bfd/elfn32-mips.c -@@ -4125,10 +4125,8 @@ static const struct ecoff_debug_swap mip - #define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mips_elf_adjust_dynamic_symbol --#define elf_backend_always_size_sections \ -- _bfd_mips_elf_always_size_sections --#define elf_backend_size_dynamic_sections \ -- _bfd_mips_elf_size_dynamic_sections -+#define elf_backend_early_size_sections _bfd_mips_elf_early_size_sections -+#define elf_backend_late_size_sections _bfd_mips_elf_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section _bfd_mips_elf_relocate_section - #define elf_backend_finish_dynamic_symbol \ ---- a/bfd/elfnn-aarch64.c -+++ b/bfd/elfnn-aarch64.c -@@ -112,7 +112,7 @@ - allocate space for one relocation on the slot. Record the GOT offset - for this symbol. - -- elfNN_aarch64_size_dynamic_sections () -+ elfNN_aarch64_late_size_sections () - - Iterate all input BFDS, look for in the local symbol data structure - constructed earlier for local TLS symbols and allocate them double -@@ -8886,8 +8886,8 @@ elfNN_aarch64_allocate_local_ifunc_dynre - though ! */ - - static bool --elfNN_aarch64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elfNN_aarch64_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_aarch64_link_hash_table *htab; - bfd *dynobj; -@@ -8898,7 +8898,8 @@ elfNN_aarch64_size_dynamic_sections (bfd - htab = elf_aarch64_hash_table ((info)); - dynobj = htab->root.dynobj; - -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->root.dynamic_sections_created) - { -@@ -9300,8 +9301,8 @@ elfNN_aarch64_create_small_pltn_entry (s - _TLS_MODULE_BASE_, if needed. */ - - static bool --elfNN_aarch64_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elfNN_aarch64_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - asection *tls_sec; - -@@ -10036,8 +10037,8 @@ const struct elf_size_info elfNN_aarch64 - #define elf_backend_adjust_dynamic_symbol \ - elfNN_aarch64_adjust_dynamic_symbol - --#define elf_backend_always_size_sections \ -- elfNN_aarch64_always_size_sections -+#define elf_backend_early_size_sections \ -+ elfNN_aarch64_early_size_sections - - #define elf_backend_check_relocs \ - elfNN_aarch64_check_relocs -@@ -10086,8 +10087,8 @@ const struct elf_size_info elfNN_aarch64 - #define elf_backend_section_from_shdr \ - elfNN_aarch64_section_from_shdr - --#define elf_backend_size_dynamic_sections \ -- elfNN_aarch64_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ elfNN_aarch64_late_size_sections - - #define elf_backend_size_info \ - elfNN_aarch64_size_info ---- a/bfd/elfnn-ia64.c -+++ b/bfd/elfnn-ia64.c -@@ -2986,8 +2986,8 @@ elfNN_ia64_adjust_dynamic_symbol (struct - } - - static bool --elfNN_ia64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elfNN_ia64_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elfNN_ia64_allocate_data data; - struct elfNN_ia64_link_hash_table *ia64_info; -@@ -2998,8 +2998,9 @@ elfNN_ia64_size_dynamic_sections (bfd *o - if (ia64_info == NULL) - return false; - dynobj = ia64_info->root.dynobj; -+ if (dynobj == NULL) -+ return true; - ia64_info->self_dtpmod_offset = (bfd_vma) -1; -- BFD_ASSERT(dynobj != NULL); - data.info = info; - - /* Set the contents of the .interp section to the interpreter. */ -@@ -5035,8 +5036,8 @@ ignore_errors (const char *fmt ATTRIBUTE - elfNN_ia64_check_relocs - #define elf_backend_adjust_dynamic_symbol \ - elfNN_ia64_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections \ -- elfNN_ia64_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ elfNN_ia64_late_size_sections - #define elf_backend_omit_section_dynsym \ - _bfd_elf_omit_section_dynsym_all - #define elf_backend_relocate_section \ ---- a/bfd/elfnn-loongarch.c -+++ b/bfd/elfnn-loongarch.c -@@ -1280,8 +1280,8 @@ maybe_set_textrel (struct elf_link_hash_ - } - - static bool --loongarch_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+loongarch_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - struct loongarch_elf_link_hash_table *htab; - bfd *dynobj; -@@ -1291,7 +1291,8 @@ loongarch_elf_size_dynamic_sections (bfd - htab = loongarch_elf_hash_table (info); - BFD_ASSERT (htab != NULL); - dynobj = htab->elf.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->elf.dynamic_sections_created) - { -@@ -3444,7 +3445,7 @@ elf_loongarch64_hash_symbol (struct elf_ - loongarch_elf_create_dynamic_sections - #define elf_backend_check_relocs loongarch_elf_check_relocs - #define elf_backend_adjust_dynamic_symbol loongarch_elf_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections loongarch_elf_size_dynamic_sections -+#define elf_backend_late_size_sections loongarch_elf_late_size_sections - #define elf_backend_relocate_section loongarch_elf_relocate_section - #define elf_backend_finish_dynamic_symbol loongarch_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections \ ---- a/bfd/elfnn-riscv.c -+++ b/bfd/elfnn-riscv.c -@@ -1376,7 +1376,7 @@ allocate_local_ifunc_dynrelocs (void **s - } - - static bool --riscv_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+riscv_elf_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - struct riscv_elf_link_hash_table *htab; - bfd *dynobj; -@@ -1386,7 +1386,8 @@ riscv_elf_size_dynamic_sections (bfd *ou - htab = riscv_elf_hash_table (info); - BFD_ASSERT (htab != NULL); - dynobj = htab->elf.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -5256,7 +5257,7 @@ riscv_elf_merge_symbol_attribute (struct - #define elf_backend_create_dynamic_sections riscv_elf_create_dynamic_sections - #define elf_backend_check_relocs riscv_elf_check_relocs - #define elf_backend_adjust_dynamic_symbol riscv_elf_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections riscv_elf_size_dynamic_sections -+#define elf_backend_late_size_sections riscv_elf_late_size_sections - #define elf_backend_relocate_section riscv_elf_relocate_section - #define elf_backend_finish_dynamic_symbol riscv_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections riscv_elf_finish_dynamic_sections ---- a/bfd/elfxx-mips.c -+++ b/bfd/elfxx-mips.c -@@ -9559,8 +9559,8 @@ _bfd_mips_elf_adjust_dynamic_symbol (str - check for any mips16 stub sections that we can discard. */ - - bool --_bfd_mips_elf_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+_bfd_mips_elf_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - asection *sect; - struct mips_elf_link_hash_table *htab; -@@ -9903,8 +9903,8 @@ mips_elf_set_plt_sym_value (struct mips_ - /* Set the sizes of the dynamic sections. */ - - bool --_bfd_mips_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+_bfd_mips_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s, *sreldyn; -@@ -9914,7 +9914,8 @@ _bfd_mips_elf_size_dynamic_sections (bfd - htab = mips_elf_hash_table (info); - BFD_ASSERT (htab != NULL); - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -14833,7 +14834,7 @@ _bfd_mips_elf_final_link (bfd *abfd, str - input_section->flags &= ~SEC_HAS_CONTENTS; - } - -- /* Size has been set in _bfd_mips_elf_always_size_sections. */ -+ /* Size has been set in _bfd_mips_elf_early_size_sections. */ - BFD_ASSERT(o->size == sizeof (Elf_External_ABIFlags_v0)); - - /* Skip this section later on (I don't think this currently -@@ -14892,7 +14893,7 @@ _bfd_mips_elf_final_link (bfd *abfd, str - input_section->flags &= ~SEC_HAS_CONTENTS; - } - -- /* Size has been set in _bfd_mips_elf_always_size_sections. */ -+ /* Size has been set in _bfd_mips_elf_early_size_sections. */ - BFD_ASSERT(o->size == sizeof (Elf32_External_RegInfo)); - - /* Skip this section later on (I don't think this currently ---- a/bfd/elfxx-mips.h -+++ b/bfd/elfxx-mips.h -@@ -52,9 +52,9 @@ extern bool _bfd_mips_elf_check_relocs - (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *); - extern bool _bfd_mips_elf_adjust_dynamic_symbol - (struct bfd_link_info *, struct elf_link_hash_entry *); --extern bool _bfd_mips_elf_always_size_sections -+extern bool _bfd_mips_elf_early_size_sections - (bfd *, struct bfd_link_info *); --extern bool _bfd_mips_elf_size_dynamic_sections -+extern bool _bfd_mips_elf_late_size_sections - (bfd *, struct bfd_link_info *); - extern int _bfd_mips_elf_relocate_section - (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, ---- a/bfd/elfxx-sparc.c -+++ b/bfd/elfxx-sparc.c -@@ -2381,8 +2381,8 @@ _bfd_sparc_elf_omit_section_dynsym (bfd - /* Set the sizes of the dynamic sections. */ - - bool --_bfd_sparc_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+_bfd_sparc_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - struct _bfd_sparc_elf_link_hash_table *htab; - bfd *dynobj; -@@ -2392,7 +2392,8 @@ _bfd_sparc_elf_size_dynamic_sections (bf - htab = _bfd_sparc_elf_hash_table (info); - BFD_ASSERT (htab != NULL); - dynobj = htab->elf.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { ---- a/bfd/elfxx-sparc.h -+++ b/bfd/elfxx-sparc.h -@@ -117,7 +117,7 @@ extern bool _bfd_sparc_elf_adjust_dynami - (struct bfd_link_info *, struct elf_link_hash_entry *); - extern bool _bfd_sparc_elf_omit_section_dynsym - (bfd *, struct bfd_link_info *, asection *); --extern bool _bfd_sparc_elf_size_dynamic_sections -+extern bool _bfd_sparc_elf_late_size_sections - (bfd *, struct bfd_link_info *); - extern bool _bfd_sparc_elf_new_section_hook - (bfd *, asection *); ---- a/bfd/elfxx-target.h -+++ b/bfd/elfxx-target.h -@@ -483,11 +483,11 @@ - #ifndef elf_backend_adjust_dynamic_symbol - #define elf_backend_adjust_dynamic_symbol 0 - #endif --#ifndef elf_backend_always_size_sections --#define elf_backend_always_size_sections 0 -+#ifndef elf_backend_early_size_sections -+#define elf_backend_early_size_sections 0 - #endif --#ifndef elf_backend_size_dynamic_sections --#define elf_backend_size_dynamic_sections 0 -+#ifndef elf_backend_late_size_sections -+#define elf_backend_late_size_sections 0 - #endif - #ifndef elf_backend_strip_zero_sized_dynamic_sections - #define elf_backend_strip_zero_sized_dynamic_sections 0 -@@ -842,8 +842,8 @@ static const struct elf_backend_data elf - elf_backend_check_directives, - elf_backend_notice_as_needed, - elf_backend_adjust_dynamic_symbol, -- elf_backend_always_size_sections, -- elf_backend_size_dynamic_sections, -+ elf_backend_early_size_sections, -+ elf_backend_late_size_sections, - elf_backend_strip_zero_sized_dynamic_sections, - elf_backend_init_index_section, - elf_backend_relocate_section, ---- a/bfd/elfxx-tilegx.c -+++ b/bfd/elfxx-tilegx.c -@@ -2430,8 +2430,8 @@ tilegx_elf_omit_section_dynsym (bfd *out - } - - bool --tilegx_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+tilegx_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct tilegx_elf_link_hash_table *htab; - bfd *dynobj; -@@ -2441,7 +2441,8 @@ tilegx_elf_size_dynamic_sections (bfd *o - htab = tilegx_elf_hash_table (info); - BFD_ASSERT (htab != NULL); - dynobj = htab->elf.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { ---- a/bfd/elfxx-tilegx.h -+++ b/bfd/elfxx-tilegx.h -@@ -57,7 +57,7 @@ tilegx_elf_omit_section_dynsym (bfd *, - asection *); - - extern bool --tilegx_elf_size_dynamic_sections (bfd *, struct bfd_link_info *); -+tilegx_elf_late_size_sections (bfd *, struct bfd_link_info *); - - extern int - tilegx_elf_relocate_section (bfd *, struct bfd_link_info *, ---- a/bfd/elfxx-x86.c -+++ b/bfd/elfxx-x86.c -@@ -2019,7 +2019,7 @@ _bfd_elf_x86_valid_reloc_p (asection *in - /* Set the sizes of the dynamic sections. */ - - bool --_bfd_x86_elf_size_dynamic_sections (bfd *output_bfd, -+_bfd_x86_elf_late_size_sections (bfd *output_bfd, - struct bfd_link_info *info) - { - struct elf_x86_link_hash_table *htab; -@@ -2035,7 +2035,7 @@ _bfd_x86_elf_size_dynamic_sections (bfd - return false; - dynobj = htab->elf.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - /* Set up .got offsets for local syms, and space for local dynamic - relocs. */ -@@ -2616,8 +2616,8 @@ _bfd_x86_elf_finish_dynamic_sections (bf - - - bool --_bfd_x86_elf_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+_bfd_x86_elf_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - asection *tls_sec = elf_hash_table (info)->tls_sec; - ---- a/bfd/elfxx-x86.h -+++ b/bfd/elfxx-x86.h -@@ -807,13 +807,13 @@ extern bool _bfd_elf_x86_valid_reloc_p - const Elf_Internal_Rela *, struct elf_link_hash_entry *, - Elf_Internal_Sym *, Elf_Internal_Shdr *, bool *); - --extern bool _bfd_x86_elf_size_dynamic_sections -+extern bool _bfd_x86_elf_late_size_sections - (bfd *, struct bfd_link_info *); - - extern struct elf_x86_link_hash_table *_bfd_x86_elf_finish_dynamic_sections - (bfd *, struct bfd_link_info *); - --extern bool _bfd_x86_elf_always_size_sections -+extern bool _bfd_x86_elf_early_size_sections - (bfd *, struct bfd_link_info *); - - extern void _bfd_x86_elf_merge_symbol_attribute -@@ -885,8 +885,8 @@ extern void _bfd_x86_elf_link_report_rel - - #define elf_backend_check_relocs \ - _bfd_x86_elf_check_relocs --#define elf_backend_size_dynamic_sections \ -- _bfd_x86_elf_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ _bfd_x86_elf_late_size_sections - #define elf_backend_merge_symbol_attribute \ - _bfd_x86_elf_merge_symbol_attribute - #define elf_backend_copy_indirect_symbol \ ---- a/ld/emultempl/vms.em -+++ b/ld/emultempl/vms.em -@@ -196,10 +196,9 @@ gld${EMULATION_NAME}_before_allocation ( - - /* The backend must work out the sizes of all the other dynamic - sections. */ -- if (elf_hash_table (&link_info)->dynamic_sections_created -- && bed->elf_backend_size_dynamic_sections -- && ! (*bed->elf_backend_size_dynamic_sections) (link_info.output_bfd, -- &link_info)) -+ if (bed->elf_backend_late_size_sections -+ && !bed->elf_backend_late_size_sections (link_info.output_bfd, -+ &link_info)) - einfo (_("%F%P: failed to set dynamic section sizes: %E\n")); - - before_allocation_default (); diff --git a/toolchain/binutils/patches/2.39/002-PR-30569-delete-_bfd_mips_elf_early_size_sections.patch b/toolchain/binutils/patches/2.39/002-PR-30569-delete-_bfd_mips_elf_early_size_sections.patch deleted file mode 100644 index f0c0d7a10a..0000000000 --- a/toolchain/binutils/patches/2.39/002-PR-30569-delete-_bfd_mips_elf_early_size_sections.patch +++ /dev/null @@ -1,218 +0,0 @@ -From 3c6c32951e292a51ede70b8087bb0308d7dbc4fc Mon Sep 17 00:00:00 2001 -From: Alan Modra <amodra@gmail.com> -Date: Thu, 28 Mar 2024 20:33:32 +1030 -Subject: [PATCH 2/2] PR 30569, delete _bfd_mips_elf_early_size_sections - -PR30569 was triggered by a patch of mine 6540edd52cc0 moving the call -to always_size_sections in bfd_elf_size_dynamic_sections earlier, made -to support the x86 DT_RELR implementation. This broke mips16 code -handling stubs when --export-dynamic is passed to the linker, because -numerous symbols then became dynamic after always_size_sections. The -mips backend fiddles with symbols in its always_size_sections. Maciej -in 902e9fc76a0e had moved the call to always_size_sections to after -the export-dynamic code. Prior to that, Nathan in 04c3a75556c0 moved -it before the exec stack code, back to the start of -bfd_elf_size_dynamic_sections which was where Ian put it originally -in ff12f303355b. So the call has moved around a little. I'm leaving -it where it is, and instead calling mips_elf_check_symbols from -late_size_sections (the old size_dynamic_sections) which is now always -called. In fact, the whole of _bfd_mips_elf_early_size_sections can -be merged into _bfd_mips_elf_late_size_sections. ---- - bfd/elf32-mips.c | 1 - - bfd/elf64-mips.c | 2 -- - bfd/elfn32-mips.c | 1 - - bfd/elfxx-mips.c | 84 +++++++++++++++++++---------------------------- - bfd/elfxx-mips.h | 2 -- - 5 files changed, 34 insertions(+), 56 deletions(-) - ---- a/bfd/elf32-mips.c -+++ b/bfd/elf32-mips.c -@@ -2525,7 +2525,6 @@ static const struct ecoff_debug_swap mip - #define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mips_elf_adjust_dynamic_symbol --#define elf_backend_early_size_sections _bfd_mips_elf_early_size_sections - #define elf_backend_late_size_sections _bfd_mips_elf_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section _bfd_mips_elf_relocate_section ---- a/bfd/elf64-mips.c -+++ b/bfd/elf64-mips.c -@@ -4739,8 +4739,6 @@ const struct elf_size_info mips_elf64_si - #define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mips_elf_adjust_dynamic_symbol --#define elf_backend_early_size_sections \ -- _bfd_mips_elf_early_size_sections - #define elf_backend_late_size_sections \ - _bfd_mips_elf_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section ---- a/bfd/elfn32-mips.c -+++ b/bfd/elfn32-mips.c -@@ -4125,7 +4125,6 @@ static const struct ecoff_debug_swap mip - #define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mips_elf_adjust_dynamic_symbol --#define elf_backend_early_size_sections _bfd_mips_elf_early_size_sections - #define elf_backend_late_size_sections _bfd_mips_elf_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section _bfd_mips_elf_relocate_section ---- a/bfd/elfxx-mips.c -+++ b/bfd/elfxx-mips.c -@@ -9554,48 +9554,6 @@ _bfd_mips_elf_adjust_dynamic_symbol (str - return _bfd_elf_adjust_dynamic_copy (info, h, s); - } - --/* This function is called after all the input files have been read, -- and the input sections have been assigned to output sections. We -- check for any mips16 stub sections that we can discard. */ -- --bool --_bfd_mips_elf_early_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) --{ -- asection *sect; -- struct mips_elf_link_hash_table *htab; -- struct mips_htab_traverse_info hti; -- -- htab = mips_elf_hash_table (info); -- BFD_ASSERT (htab != NULL); -- -- /* The .reginfo section has a fixed size. */ -- sect = bfd_get_section_by_name (output_bfd, ".reginfo"); -- if (sect != NULL) -- { -- bfd_set_section_size (sect, sizeof (Elf32_External_RegInfo)); -- sect->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS; -- } -- -- /* The .MIPS.abiflags section has a fixed size. */ -- sect = bfd_get_section_by_name (output_bfd, ".MIPS.abiflags"); -- if (sect != NULL) -- { -- bfd_set_section_size (sect, sizeof (Elf_External_ABIFlags_v0)); -- sect->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS; -- } -- -- hti.info = info; -- hti.output_bfd = output_bfd; -- hti.error = false; -- mips_elf_link_hash_traverse (mips_elf_hash_table (info), -- mips_elf_check_symbols, &hti); -- if (hti.error) -- return false; -- -- return true; --} -- - /* If the link uses a GOT, lay it out and work out its size. */ - - static bool -@@ -9900,7 +9858,8 @@ mips_elf_set_plt_sym_value (struct mips_ - return true; - } - --/* Set the sizes of the dynamic sections. */ -+/* Set the sizes of the dynamic sections, some mips non-dynamic sections, -+ and check for any mips16 stub sections that we can discard. */ - - bool - _bfd_mips_elf_late_size_sections (bfd *output_bfd, -@@ -9910,14 +9869,39 @@ _bfd_mips_elf_late_size_sections (bfd *o - asection *s, *sreldyn; - bool reltext; - struct mips_elf_link_hash_table *htab; -+ struct mips_htab_traverse_info hti; - - htab = mips_elf_hash_table (info); - BFD_ASSERT (htab != NULL); -- dynobj = elf_hash_table (info)->dynobj; -+ -+ /* The .reginfo section has a fixed size. */ -+ s = bfd_get_section_by_name (output_bfd, ".reginfo"); -+ if (s != NULL) -+ { -+ bfd_set_section_size (s, sizeof (Elf32_External_RegInfo)); -+ s->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS; -+ } -+ -+ /* The .MIPS.abiflags section has a fixed size. */ -+ s = bfd_get_section_by_name (output_bfd, ".MIPS.abiflags"); -+ if (s != NULL) -+ { -+ bfd_set_section_size (s, sizeof (Elf_External_ABIFlags_v0)); -+ s->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS; -+ } -+ -+ hti.info = info; -+ hti.output_bfd = output_bfd; -+ hti.error = false; -+ mips_elf_link_hash_traverse (htab, mips_elf_check_symbols, &hti); -+ if (hti.error) -+ return false; -+ -+ dynobj = htab->root.dynobj; - if (dynobj == NULL) - return true; - -- if (elf_hash_table (info)->dynamic_sections_created) -+ if (htab->root.dynamic_sections_created) - { - /* Set the contents of the .interp section to the interpreter. */ - if (bfd_link_executable (info) && !info->nointerp) -@@ -10057,7 +10041,7 @@ _bfd_mips_elf_late_size_sections (bfd *o - } - } - else if (bfd_link_executable (info) -- && ! mips_elf_hash_table (info)->use_rld_obj_head -+ && !htab->use_rld_obj_head - && startswith (name, ".rld_map")) - { - /* We add a room for __rld_map. It will be filled in by the -@@ -10066,7 +10050,7 @@ _bfd_mips_elf_late_size_sections (bfd *o - } - else if (SGI_COMPAT (output_bfd) - && startswith (name, ".compact_rel")) -- s->size += mips_elf_hash_table (info)->compact_rel_size; -+ s->size += htab->compact_rel_size; - else if (s == htab->root.splt) - { - /* If the last PLT entry has a branch delay slot, allocate -@@ -10106,7 +10090,7 @@ _bfd_mips_elf_late_size_sections (bfd *o - } - } - -- if (elf_hash_table (info)->dynamic_sections_created) -+ if (htab->root.dynamic_sections_created) - { - /* Add some entries to the .dynamic section. We fill in the - values later, in _bfd_mips_elf_finish_dynamic_sections, but we -@@ -14834,7 +14818,7 @@ _bfd_mips_elf_final_link (bfd *abfd, str - input_section->flags &= ~SEC_HAS_CONTENTS; - } - -- /* Size has been set in _bfd_mips_elf_early_size_sections. */ -+ /* Size has been set in _bfd_mips_elf_late_size_sections. */ - BFD_ASSERT(o->size == sizeof (Elf_External_ABIFlags_v0)); - - /* Skip this section later on (I don't think this currently -@@ -14893,7 +14877,7 @@ _bfd_mips_elf_final_link (bfd *abfd, str - input_section->flags &= ~SEC_HAS_CONTENTS; - } - -- /* Size has been set in _bfd_mips_elf_early_size_sections. */ -+ /* Size has been set in _bfd_mips_elf_late_size_sections. */ - BFD_ASSERT(o->size == sizeof (Elf32_External_RegInfo)); - - /* Skip this section later on (I don't think this currently ---- a/bfd/elfxx-mips.h -+++ b/bfd/elfxx-mips.h -@@ -52,8 +52,6 @@ extern bool _bfd_mips_elf_check_relocs - (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *); - extern bool _bfd_mips_elf_adjust_dynamic_symbol - (struct bfd_link_info *, struct elf_link_hash_entry *); --extern bool _bfd_mips_elf_early_size_sections -- (bfd *, struct bfd_link_info *); - extern bool _bfd_mips_elf_late_size_sections - (bfd *, struct bfd_link_info *); - extern int _bfd_mips_elf_relocate_section diff --git a/toolchain/binutils/patches/2.39/005-ld-fix-NEWS-typos.patch b/toolchain/binutils/patches/2.39/005-ld-fix-NEWS-typos.patch deleted file mode 100644 index 39c61d9319..0000000000 --- a/toolchain/binutils/patches/2.39/005-ld-fix-NEWS-typos.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 9284b63ea39cecbfc1522d9e143ecb7727d77eb5 Mon Sep 17 00:00:00 2001 -From: Martin Liska <mliska@suse.cz> -Date: Mon, 8 Aug 2022 13:22:26 +0200 -Subject: [PATCH 005/160] ld: fix NEWS typos - -ld/ChangeLog: - - * NEWS: Fix 2 typos. ---- - ld/NEWS | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/ld/NEWS -+++ b/ld/NEWS -@@ -27,10 +27,10 @@ Changes in 2.39: - --enable-warn-rwx-segments=no - will make --no-warn-rwx-segments enabled by default. - -- --enable-defaul-execstack=no -+ --enable-default-execstack=no - will stop the creation of an executable stack simply because an input file - is missing a .note.GNU-stack section, even on architectures where this -- ehaviour is the default. -+ behaviour is the default. - - * TYPE=<type> is now supported in an output section description to set the - section type value. diff --git a/toolchain/binutils/patches/2.39/008-gas-Dwarf-properly-skip-zero-size-functions.patch b/toolchain/binutils/patches/2.39/008-gas-Dwarf-properly-skip-zero-size-functions.patch deleted file mode 100644 index 055da84129..0000000000 --- a/toolchain/binutils/patches/2.39/008-gas-Dwarf-properly-skip-zero-size-functions.patch +++ /dev/null @@ -1,90 +0,0 @@ -From e8cf73215187b0c08679d726a5cc7c019fa3ea2e Mon Sep 17 00:00:00 2001 -From: Jan Beulich <jbeulich@suse.com> -Date: Wed, 10 Aug 2022 10:34:22 +0200 -Subject: [PATCH 008/160] gas/Dwarf: properly skip zero-size functions - -PR gas/29451 - -While out_debug_abbrev() properly skips such functions, out_debug_info() -mistakenly didn't. It needs to calculate the high_pc expression ahead of -time, in order to skip emitting any data for the function if the value -is zero. - -The one case which would still leave a zero-size entry is when -symbol_get_obj(symp)->size ends up evaluating to zero. I hope we can -expect that to not be the case, otherwise we'd need to have a way to -post-process .debug_info contents between resolving expressions and -actually writing the data out to the file. Even then it wouldn't be -entirely obvious in which way to alter the data. - -(cherry picked from commit d7abcbcea5ddd40a3bf28758b62f35933c59f996) ---- - gas/dwarf2dbg.c | 39 ++++++++++++++++++++------------------- - 1 file changed, 20 insertions(+), 19 deletions(-) - ---- a/gas/dwarf2dbg.c -+++ b/gas/dwarf2dbg.c -@@ -2882,6 +2882,7 @@ out_debug_info (segT info_seg, segT abbr - { - const char *name; - size_t len; -+ expressionS size = { .X_op = O_constant }; - - /* Skip warning constructs (see above). */ - if (symbol_get_bfdsym (symp)->flags & BSF_WARNING) -@@ -2895,6 +2896,18 @@ out_debug_info (segT info_seg, segT abbr - if (!S_IS_DEFINED (symp) || !S_IS_FUNCTION (symp)) - continue; - -+#if defined (OBJ_ELF) /* || defined (OBJ_MAYBE_ELF) */ -+ size.X_add_number = S_GET_SIZE (symp); -+ if (size.X_add_number == 0 && IS_ELF -+ && symbol_get_obj (symp)->size != NULL) -+ { -+ size.X_op = O_add; -+ size.X_op_symbol = make_expr_symbol (symbol_get_obj (symp)->size); -+ } -+#endif -+ if (size.X_op == O_constant && size.X_add_number == 0) -+ continue; -+ - subseg_set (str_seg, 0); - name_sym = symbol_temp_new_now_octets (); - name = S_GET_NAME (symp); -@@ -2920,29 +2933,17 @@ out_debug_info (segT info_seg, segT abbr - emit_expr (&exp, sizeof_address); - - /* DW_AT_high_pc */ -- exp.X_op = O_constant; --#if defined (OBJ_ELF) /* || defined (OBJ_MAYBE_ELF) */ -- exp.X_add_number = S_GET_SIZE (symp); -- if (exp.X_add_number == 0 && IS_ELF -- && symbol_get_obj (symp)->size != NULL) -- { -- exp.X_op = O_add; -- exp.X_op_symbol = make_expr_symbol (symbol_get_obj (symp)->size); -- } --#else -- exp.X_add_number = 0; --#endif - if (DWARF2_VERSION < 4) - { -- if (exp.X_op == O_constant) -- exp.X_op = O_symbol; -- exp.X_add_symbol = symp; -- emit_expr (&exp, sizeof_address); -+ if (size.X_op == O_constant) -+ size.X_op = O_symbol; -+ size.X_add_symbol = symp; -+ emit_expr (&size, sizeof_address); - } -- else if (exp.X_op == O_constant) -- out_uleb128 (exp.X_add_number); -+ else if (size.X_op == O_constant) -+ out_uleb128 (size.X_add_number); - else -- emit_leb128_expr (symbol_get_value_expression (exp.X_op_symbol), 0); -+ emit_leb128_expr (symbol_get_value_expression (size.X_op_symbol), 0); - } - - /* End of children. */ diff --git a/toolchain/binutils/patches/2.39/009-PR29462-internal-error-in-relocate-at-powerpc.cc-107.patch b/toolchain/binutils/patches/2.39/009-PR29462-internal-error-in-relocate-at-powerpc.cc-107.patch deleted file mode 100644 index e325d3bcb0..0000000000 --- a/toolchain/binutils/patches/2.39/009-PR29462-internal-error-in-relocate-at-powerpc.cc-107.patch +++ /dev/null @@ -1,270 +0,0 @@ -From e3b5d935247084dca057dea72be61b063fe2357a Mon Sep 17 00:00:00 2001 -From: Alan Modra <amodra@gmail.com> -Date: Wed, 10 Aug 2022 10:38:52 +0930 -Subject: [PATCH 009/160] PR29462, internal error in relocate, at - powerpc.cc:10796 - -Prior to the inline plt call support (commit 08be322439), the only -local syms with plt entries were local ifunc symbols. There shouldn't -be stubs for other local symbols so don't look for them. The patch -also fixes minor bugs in get_reference_flags; Many relocs are valid -only for ppc64 and a couple only for ppc32. - - PR 29462 - * powerpc.cc (Target_powerpc::Relocate::relocate): Rename - use_plt_offset to pltcal_to_direct, invert logic. For relocs - not used with inline plt sequences against local symbols, only - look for stubs when the symbol is an ifunc. - (Target_powerpc::Scan::get_reference_flags): Correct reloc - handling for relocs not valid for both 32-bit and 64-bit. - -(cherry picked from commit 6158b25f77db11712b84e6a4609898f2615ac749) ---- - gold/powerpc.cc | 129 ++++++++++++++++++++++++++++-------------------- - 1 file changed, 75 insertions(+), 54 deletions(-) - ---- a/gold/powerpc.cc -+++ b/gold/powerpc.cc -@@ -7675,22 +7675,18 @@ Target_powerpc<size, big_endian>::Scan:: - - switch (r_type) - { -+ case elfcpp::R_PPC64_TOC: -+ if (size != 64) -+ break; -+ // Fall through. - case elfcpp::R_POWERPC_NONE: - case elfcpp::R_POWERPC_GNU_VTINHERIT: - case elfcpp::R_POWERPC_GNU_VTENTRY: -- case elfcpp::R_PPC64_TOC: - // No symbol reference. - break; - - case elfcpp::R_PPC64_ADDR64: - case elfcpp::R_PPC64_UADDR64: -- case elfcpp::R_POWERPC_ADDR32: -- case elfcpp::R_POWERPC_UADDR32: -- case elfcpp::R_POWERPC_ADDR16: -- case elfcpp::R_POWERPC_UADDR16: -- case elfcpp::R_POWERPC_ADDR16_LO: -- case elfcpp::R_POWERPC_ADDR16_HI: -- case elfcpp::R_POWERPC_ADDR16_HA: - case elfcpp::R_PPC64_ADDR16_HIGHER34: - case elfcpp::R_PPC64_ADDR16_HIGHERA34: - case elfcpp::R_PPC64_ADDR16_HIGHEST34: -@@ -7700,6 +7696,16 @@ Target_powerpc<size, big_endian>::Scan:: - case elfcpp::R_PPC64_D34_HI30: - case elfcpp::R_PPC64_D34_HA30: - case elfcpp::R_PPC64_D28: -+ if (size != 64) -+ break; -+ // Fall through. -+ case elfcpp::R_POWERPC_ADDR32: -+ case elfcpp::R_POWERPC_UADDR32: -+ case elfcpp::R_POWERPC_ADDR16: -+ case elfcpp::R_POWERPC_UADDR16: -+ case elfcpp::R_POWERPC_ADDR16_LO: -+ case elfcpp::R_POWERPC_ADDR16_HI: -+ case elfcpp::R_POWERPC_ADDR16_HA: - ref = Symbol::ABSOLUTE_REF; - break; - -@@ -7710,13 +7716,14 @@ Target_powerpc<size, big_endian>::Scan:: - ref = Symbol::FUNCTION_CALL | Symbol::ABSOLUTE_REF; - break; - -- case elfcpp::R_PPC64_REL64: -- case elfcpp::R_POWERPC_REL32: - case elfcpp::R_PPC_LOCAL24PC: -- case elfcpp::R_POWERPC_REL16: -- case elfcpp::R_POWERPC_REL16_LO: -- case elfcpp::R_POWERPC_REL16_HI: -- case elfcpp::R_POWERPC_REL16_HA: -+ if (size != 32) -+ break; -+ // Fall through. -+ ref = Symbol::RELATIVE_REF; -+ break; -+ -+ case elfcpp::R_PPC64_REL64: - case elfcpp::R_PPC64_REL16_HIGH: - case elfcpp::R_PPC64_REL16_HIGHA: - case elfcpp::R_PPC64_REL16_HIGHER: -@@ -7729,36 +7736,45 @@ Target_powerpc<size, big_endian>::Scan:: - case elfcpp::R_PPC64_REL16_HIGHEST34: - case elfcpp::R_PPC64_REL16_HIGHESTA34: - case elfcpp::R_PPC64_PCREL28: -+ if (size != 64) -+ break; -+ // Fall through. -+ case elfcpp::R_POWERPC_REL32: -+ case elfcpp::R_POWERPC_REL16: -+ case elfcpp::R_POWERPC_REL16_LO: -+ case elfcpp::R_POWERPC_REL16_HI: -+ case elfcpp::R_POWERPC_REL16_HA: - ref = Symbol::RELATIVE_REF; - break; - -+ case elfcpp::R_PPC_PLTREL24: -+ if (size != 32) -+ break; -+ ref = Symbol::FUNCTION_CALL | Symbol::RELATIVE_REF; -+ break; -+ - case elfcpp::R_PPC64_REL24_NOTOC: -- if (size == 32) -+ case elfcpp::R_PPC64_REL24_P9NOTOC: -+ case elfcpp::R_PPC64_PLT16_LO_DS: -+ case elfcpp::R_PPC64_PLTSEQ_NOTOC: -+ case elfcpp::R_PPC64_PLTCALL_NOTOC: -+ case elfcpp::R_PPC64_PLT_PCREL34: -+ case elfcpp::R_PPC64_PLT_PCREL34_NOTOC: -+ if (size != 64) - break; - // Fall through. -- case elfcpp::R_PPC64_REL24_P9NOTOC: - case elfcpp::R_POWERPC_REL24: -- case elfcpp::R_PPC_PLTREL24: - case elfcpp::R_POWERPC_REL14: - case elfcpp::R_POWERPC_REL14_BRTAKEN: - case elfcpp::R_POWERPC_REL14_BRNTAKEN: - case elfcpp::R_POWERPC_PLT16_LO: - case elfcpp::R_POWERPC_PLT16_HI: - case elfcpp::R_POWERPC_PLT16_HA: -- case elfcpp::R_PPC64_PLT16_LO_DS: - case elfcpp::R_POWERPC_PLTSEQ: -- case elfcpp::R_PPC64_PLTSEQ_NOTOC: - case elfcpp::R_POWERPC_PLTCALL: -- case elfcpp::R_PPC64_PLTCALL_NOTOC: -- case elfcpp::R_PPC64_PLT_PCREL34: -- case elfcpp::R_PPC64_PLT_PCREL34_NOTOC: - ref = Symbol::FUNCTION_CALL | Symbol::RELATIVE_REF; - break; - -- case elfcpp::R_POWERPC_GOT16: -- case elfcpp::R_POWERPC_GOT16_LO: -- case elfcpp::R_POWERPC_GOT16_HI: -- case elfcpp::R_POWERPC_GOT16_HA: - case elfcpp::R_PPC64_GOT16_DS: - case elfcpp::R_PPC64_GOT16_LO_DS: - case elfcpp::R_PPC64_GOT_PCREL34: -@@ -7768,11 +7784,16 @@ Target_powerpc<size, big_endian>::Scan:: - case elfcpp::R_PPC64_TOC16_HA: - case elfcpp::R_PPC64_TOC16_DS: - case elfcpp::R_PPC64_TOC16_LO_DS: -+ if (size != 64) -+ break; -+ // Fall through. -+ case elfcpp::R_POWERPC_GOT16: -+ case elfcpp::R_POWERPC_GOT16_LO: -+ case elfcpp::R_POWERPC_GOT16_HI: -+ case elfcpp::R_POWERPC_GOT16_HA: - ref = Symbol::RELATIVE_REF; - break; - -- case elfcpp::R_POWERPC_GOT_TPREL16: -- case elfcpp::R_POWERPC_TLS: - case elfcpp::R_PPC64_TLSGD: - case elfcpp::R_PPC64_TLSLD: - case elfcpp::R_PPC64_TPREL34: -@@ -7781,6 +7802,11 @@ Target_powerpc<size, big_endian>::Scan:: - case elfcpp::R_PPC64_GOT_TLSLD_PCREL34: - case elfcpp::R_PPC64_GOT_TPREL_PCREL34: - case elfcpp::R_PPC64_GOT_DTPREL_PCREL34: -+ if (size != 64) -+ break; -+ // Fall through. -+ case elfcpp::R_POWERPC_GOT_TPREL16: -+ case elfcpp::R_POWERPC_TLS: - ref = Symbol::TLS_REF; - break; - -@@ -10671,10 +10697,8 @@ Target_powerpc<size, big_endian>::Reloca - bool has_stub_value = false; - bool localentry0 = false; - unsigned int r_sym = elfcpp::elf_r_sym<size>(rela.get_r_info()); -- bool use_plt_offset -- = (gsym != NULL -- ? gsym->use_plt_offset(Scan::get_reference_flags(r_type, target)) -- : object->local_has_plt_offset(r_sym)); -+ bool pltcall_to_direct = false; -+ - if (is_plt16_reloc<size>(r_type) - || r_type == elfcpp::R_PPC64_PLT_PCREL34 - || r_type == elfcpp::R_PPC64_PLT_PCREL34_NOTOC -@@ -10688,21 +10712,18 @@ Target_powerpc<size, big_endian>::Reloca - // that the decision depends on the PLTCALL reloc, and we don't - // know the address of that instruction when processing others - // in the sequence. So the decision needs to be made in -- // do_relax(). For now, don't optimise inline plt calls. -- if (gsym) -- use_plt_offset = gsym->has_plt_offset(); -- } -- if (use_plt_offset -- && !is_got_reloc(r_type) -- && !is_plt16_reloc<size>(r_type) -- && r_type != elfcpp::R_PPC64_PLT_PCREL34 -- && r_type != elfcpp::R_PPC64_PLT_PCREL34_NOTOC -- && r_type != elfcpp::R_POWERPC_PLTSEQ -- && r_type != elfcpp::R_POWERPC_PLTCALL -- && r_type != elfcpp::R_PPC64_PLTSEQ_NOTOC -- && r_type != elfcpp::R_PPC64_PLTCALL_NOTOC -- && (!psymval->is_ifunc_symbol() -- || Scan::reloc_needs_plt_for_ifunc(target, object, r_type, false))) -+ // do_relax(). -+ pltcall_to_direct = !(gsym != NULL -+ ? gsym->has_plt_offset() -+ : object->local_has_plt_offset(r_sym)); -+ } -+ else if ((gsym != NULL -+ ? gsym->use_plt_offset(Scan::get_reference_flags(r_type, target)) -+ : psymval->is_ifunc_symbol() && object->local_has_plt_offset(r_sym)) -+ && !is_got_reloc(r_type) -+ && (!psymval->is_ifunc_symbol() -+ || Scan::reloc_needs_plt_for_ifunc(target, object, r_type, -+ false))) - { - if (size == 64 - && gsym != NULL -@@ -10796,9 +10817,9 @@ Target_powerpc<size, big_endian>::Reloca - gold_assert(has_stub_value || !(os->flags() & elfcpp::SHF_ALLOC)); - } - -- if (use_plt_offset && (is_plt16_reloc<size>(r_type) -- || r_type == elfcpp::R_PPC64_PLT_PCREL34 -- || r_type == elfcpp::R_PPC64_PLT_PCREL34_NOTOC)) -+ if (!pltcall_to_direct && (is_plt16_reloc<size>(r_type) -+ || r_type == elfcpp::R_PPC64_PLT_PCREL34 -+ || r_type == elfcpp::R_PPC64_PLT_PCREL34_NOTOC)) - { - const Output_data_plt_powerpc<size, big_endian>* plt; - if (gsym) -@@ -10826,7 +10847,7 @@ Target_powerpc<size, big_endian>::Reloca - value -= target->toc_pointer(); - } - } -- else if (!use_plt_offset -+ else if (pltcall_to_direct - && (is_plt16_reloc<size>(r_type) - || r_type == elfcpp::R_POWERPC_PLTSEQ - || r_type == elfcpp::R_PPC64_PLTSEQ_NOTOC)) -@@ -10835,7 +10856,7 @@ Target_powerpc<size, big_endian>::Reloca - elfcpp::Swap<32, big_endian>::writeval(iview, nop); - r_type = elfcpp::R_POWERPC_NONE; - } -- else if (!use_plt_offset -+ else if (pltcall_to_direct - && (r_type == elfcpp::R_PPC64_PLT_PCREL34 - || r_type == elfcpp::R_PPC64_PLT_PCREL34_NOTOC)) - { -@@ -11316,8 +11337,8 @@ Target_powerpc<size, big_endian>::Reloca - } - else if (!has_stub_value) - { -- if (!use_plt_offset && (r_type == elfcpp::R_POWERPC_PLTCALL -- || r_type == elfcpp::R_PPC64_PLTCALL_NOTOC)) -+ if (pltcall_to_direct && (r_type == elfcpp::R_POWERPC_PLTCALL -+ || r_type == elfcpp::R_PPC64_PLTCALL_NOTOC)) - { - // PLTCALL without plt entry => convert to direct call - Insn* iview = reinterpret_cast<Insn*>(view); diff --git a/toolchain/binutils/patches/2.39/011-PR29466-APP-NO_APP-with-.linefile.patch b/toolchain/binutils/patches/2.39/011-PR29466-APP-NO_APP-with-.linefile.patch deleted file mode 100644 index f7b5819929..0000000000 --- a/toolchain/binutils/patches/2.39/011-PR29466-APP-NO_APP-with-.linefile.patch +++ /dev/null @@ -1,167 +0,0 @@ -From 9e855cffa1fda44629e7f9b76dfa3e5a51a440e9 Mon Sep 17 00:00:00 2001 -From: Alan Modra <amodra@gmail.com> -Date: Thu, 11 Aug 2022 09:51:03 +0930 -Subject: [PATCH 011/160] PR29466, APP/NO_APP with .linefile - -Commit 53f2b36a54b9 exposed a bug in sb_scrub_and_add_sb that could -result in losing input. If scrubbing results in expansion past the -holding capacity of do_scrub_chars output buffer, then do_scrub_chars -stashes the extra input for the next call. That call never came -because sb_scrub_and_add_sb wrongly decided it was done. Fix that by -allowing sb_scrub_and_add_sb to see whether there is pending input. -Also allow a little extra space so that in most cases we won't need -to resize the output buffer. - -sb_scrub_and_add_sb also limited output to the size of the input, -rather than the actual output buffer size. Fixing that resulted in a -fail of gas/testsuite/macros/dot with an extra warning: "end of file -not at end of a line; newline inserted". OK, so the macro in dot.s -really does finish without end-of-line. Apparently the macro -expansion code relied on do_scrub_chars returning early. So fix that -too by adding a newline if needed in macro_expand_body. - - PR 29466 - * app.c (do_scrub_pending): New function. - * as.h: Declare it. - * input-scrub.c (input_scrub_include_sb): Add extra space for - two .linefile directives. - * sb.c (sb_scrub_and_add_sb): Take into account pending input. - Allow output to max. - * macro.c (macro_expand_body): Add terminating newline. - * testsuite/config/default.exp (SIZE, SIZEFLAGS): Define. - * testsuite/gas/macros/app5.d, - * testsuite/gas/macros/app5.s: New test. - * testsuite/gas/macros/macros.exp: Run it. - -(cherry picked from commit 4d74aab7aa562fe79d4669cdad0c32610531cbc0) ---- - gas/app.c | 13 +++++++++++++ - gas/as.h | 1 + - gas/input-scrub.c | 6 ++++-- - gas/macro.c | 2 ++ - gas/sb.c | 5 +++-- - gas/testsuite/config/default.exp | 8 ++++++++ - gas/testsuite/gas/macros/app5.d | 6 ++++++ - gas/testsuite/gas/macros/app5.s | 5 +++++ - gas/testsuite/gas/macros/macros.exp | 1 + - 9 files changed, 43 insertions(+), 4 deletions(-) - create mode 100644 gas/testsuite/gas/macros/app5.d - create mode 100644 gas/testsuite/gas/macros/app5.s - ---- a/gas/app.c -+++ b/gas/app.c -@@ -1537,3 +1537,16 @@ do_scrub_chars (size_t (*get) (char *, s - last_char = to[-1]; - return to - tostart; - } -+ -+/* Return amount of pending input. */ -+ -+size_t -+do_scrub_pending (void) -+{ -+ size_t len = 0; -+ if (saved_input) -+ len += saved_input_len; -+ if (state == -1) -+ len += strlen (out_string); -+ return len; -+} ---- a/gas/as.h -+++ b/gas/as.h -@@ -460,6 +460,7 @@ void input_scrub_insert_file (char *); - char * input_scrub_new_file (const char *); - char * input_scrub_next_buffer (char **bufp); - size_t do_scrub_chars (size_t (*get) (char *, size_t), char *, size_t); -+size_t do_scrub_pending (void); - bool scan_for_multibyte_characters (const unsigned char *, const unsigned char *, bool); - int gen_to_words (LITTLENUM_TYPE *, int, long); - int had_err (void); ---- a/gas/input-scrub.c -+++ b/gas/input-scrub.c -@@ -278,9 +278,11 @@ input_scrub_include_sb (sb *from, char * - - next_saved_file = input_scrub_push (position); - -- /* Allocate sufficient space: from->len + optional newline. */ -+ /* Allocate sufficient space: from->len plus optional newline -+ plus two ".linefile " directives, plus a little more for other -+ expansion. */ - newline = from->len >= 1 && from->ptr[0] != '\n'; -- sb_build (&from_sb, from->len + newline); -+ sb_build (&from_sb, from->len + newline + 2 * sizeof (".linefile") + 30); - if (expansion == expanding_repeat && from_sb_expansion >= expanding_macro) - expansion = expanding_nested; - from_sb_expansion = expansion; ---- a/gas/macro.c -+++ b/gas/macro.c -@@ -1056,6 +1056,8 @@ macro_expand_body (sb *in, sb *out, form - loclist = f; - } - -+ if (!err && (out->len == 0 || out->ptr[out->len - 1] != '\n')) -+ sb_add_char (out, '\n'); - return err; - } - ---- a/gas/sb.c -+++ b/gas/sb.c -@@ -119,11 +119,12 @@ sb_scrub_and_add_sb (sb *ptr, sb *s) - So we loop until the input S is consumed. */ - while (1) - { -- size_t copy = s->len - (scrub_position - s->ptr); -+ size_t copy = s->len - (scrub_position - s->ptr) + do_scrub_pending (); - if (copy == 0) - break; - sb_check (ptr, copy); -- ptr->len += do_scrub_chars (scrub_from_sb, ptr->ptr + ptr->len, copy); -+ ptr->len += do_scrub_chars (scrub_from_sb, ptr->ptr + ptr->len, -+ ptr->max - ptr->len); - } - - sb_to_scrub = 0; ---- a/gas/testsuite/config/default.exp -+++ b/gas/testsuite/config/default.exp -@@ -52,6 +52,14 @@ if ![info exists NMFLAGS] then { - set NMFLAGS {} - } - -+if ![info exists SIZE] then { -+ set SIZE [findfile $base_dir/size] -+} -+ -+if ![info exists SIZEFLAGS] then { -+ set SIZEFLAGS "" -+} -+ - if ![info exists OBJCOPY] then { - set OBJCOPY [findfile $base_dir/../../binutils/objcopy] - } ---- /dev/null -+++ b/gas/testsuite/gas/macros/app5.d -@@ -0,0 +1,6 @@ -+#name: APP with linefile -+#xfail: tic30-*-* -+#size: -G -+# pr29466 just check that the test assembles -+ -+#pass ---- /dev/null -+++ b/gas/testsuite/gas/macros/app5.s -@@ -0,0 +1,5 @@ -+#NO_APP -+#APP -+# 5 "foo.c" 1 -+# 0 "" 2 -+#NO_APP ---- a/gas/testsuite/gas/macros/macros.exp -+++ b/gas/testsuite/gas/macros/macros.exp -@@ -70,6 +70,7 @@ run_dump_test app2 - run_dump_test app3 - remote_download host "$srcdir/$subdir/app4b.s" - run_dump_test app4 -+run_dump_test app5 - - run_list_test badarg "" - diff --git a/toolchain/binutils/patches/2.39/039-LoongArch-ld-Fix-relocation-error-of-pcrel.patch b/toolchain/binutils/patches/2.39/039-LoongArch-ld-Fix-relocation-error-of-pcrel.patch deleted file mode 100644 index bf452e566a..0000000000 --- a/toolchain/binutils/patches/2.39/039-LoongArch-ld-Fix-relocation-error-of-pcrel.patch +++ /dev/null @@ -1,128 +0,0 @@ -From 509a2ec6ad3ea7eb3f4cf59538cf636a2126e4c3 Mon Sep 17 00:00:00 2001 -From: liuzhensong <liuzhensong@loongson.cn> -Date: Fri, 2 Sep 2022 16:29:14 +0800 -Subject: [PATCH 039/160] LoongArch:ld: Fix relocation error of pcrel. - - Patch for branch 2.39. - Need to reduce the address of pc when using - reloction R_LARCH_SOP_PUSH_PCREL. - - bfd/ - * elfnn-loongarch.c ---- - bfd/elfnn-loongarch.c | 3 +- - ld/testsuite/ld-loongarch-elf/pcrel-const.d | 14 +++++++ - ld/testsuite/ld-loongarch-elf/pcrel-const.lds | 14 +++++++ - ld/testsuite/ld-loongarch-elf/pcrel-const.s | 12 ++++++ - ld/testsuite/ld-loongarch-elf/pr.exp | 39 +++++++++++++++++++ - 5 files changed, 81 insertions(+), 1 deletion(-) - create mode 100644 ld/testsuite/ld-loongarch-elf/pcrel-const.d - create mode 100644 ld/testsuite/ld-loongarch-elf/pcrel-const.lds - create mode 100644 ld/testsuite/ld-loongarch-elf/pcrel-const.s - create mode 100644 ld/testsuite/ld-loongarch-elf/pr.exp - ---- a/bfd/elfnn-loongarch.c -+++ b/bfd/elfnn-loongarch.c -@@ -2342,9 +2342,10 @@ loongarch_elf_relocate_section (bfd *out - case R_LARCH_SOP_PUSH_PLT_PCREL: - unresolved_reloc = false; - -- if (resolved_to_const) -+ if (!is_undefweak && resolved_to_const) - { - relocation += rel->r_addend; -+ relocation -= pc; - break; - } - else if (is_undefweak) ---- /dev/null -+++ b/ld/testsuite/ld-loongarch-elf/pcrel-const.d -@@ -0,0 +1,14 @@ -+#as: -mla-global-with-pcrel -+#objdump: -Drsz -+ -+.*:[ ]+file format .* -+ -+ -+Disassembly of section .text: -+ -+.* <foo>: -+#... -+[ ]+8:[ ]+02c04084[ ]+addi.d[ ]+\$a0,[ ]+\$a0,[ ]+16\(0x10\) -+#... -+0+14 <__sec_end>: -+#pass ---- /dev/null -+++ b/ld/testsuite/ld-loongarch-elf/pcrel-const.lds -@@ -0,0 +1,14 @@ -+ENTRY(foo); -+SECTIONS -+{ -+ .text : { -+ *(.text*) -+ } -+ -+ .data : { -+ __sec_start = .; -+ *(.gzdata) -+ __sec_end = .; -+ } -+} -+PROVIDE(__sec_size = __sec_end); ---- /dev/null -+++ b/ld/testsuite/ld-loongarch-elf/pcrel-const.s -@@ -0,0 +1,12 @@ -+ .text -+ .align 2 -+ .globl foo -+ .type foo, @function -+foo: -+ nop -+ la.global $r4,__sec_size -+ ldptr.w $r4,$r4,0 -+ jr $r1 -+ .size foo, .-foo -+ .data -+ .word 1 ---- /dev/null -+++ b/ld/testsuite/ld-loongarch-elf/pr.exp -@@ -0,0 +1,39 @@ -+# Expect script for LoongArch ELF linker tests -+# Copyright (C) 2022 Free Software Foundation, Inc. -+# -+# This file is part of the GNU Binutils. -+# -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, -+# MA 02110-1301, USA. -+# -+ -+if ![istarget loongarch64-*-*] { -+ return -+} -+ -+set link_tests [list \ -+ [list \ -+ "pcrel const" \ -+ "-T pcrel-const.lds" "" \ -+ "-mla-global-with-pcrel" \ -+ { pcrel-const.s } \ -+ [list \ -+ [list objdump -D pcrel-const.d] \ -+ ] \ -+ "pcrel-const" \ -+ ] \ -+] -+ -+run_ld_link_tests $link_tests diff --git a/toolchain/binutils/patches/2.39/043-Re-PR29466-APP-NO_APP-with-linefile.patch b/toolchain/binutils/patches/2.39/043-Re-PR29466-APP-NO_APP-with-linefile.patch deleted file mode 100644 index 1de501a1ae..0000000000 --- a/toolchain/binutils/patches/2.39/043-Re-PR29466-APP-NO_APP-with-linefile.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 4233be14a34d754a70b8b6f6fa42d21f35c6e030 Mon Sep 17 00:00:00 2001 -From: Alan Modra <amodra@gmail.com> -Date: Sat, 10 Sep 2022 07:30:57 +0930 -Subject: [PATCH 043/160] Re: PR29466, APP/NO_APP with linefile - -It looks like I copied the SIZE init across from -binutils/testsuite/config/default.exp without some necessary editing. - - PR 29466 - * testsuite/config/default.exp (SIZE): Adjust relative path. - -(cherry picked from commit 1180f540d5f2f7751b5309bdd6c38d69fcf699e7) ---- - gas/testsuite/config/default.exp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/gas/testsuite/config/default.exp -+++ b/gas/testsuite/config/default.exp -@@ -53,7 +53,7 @@ if ![info exists NMFLAGS] then { - } - - if ![info exists SIZE] then { -- set SIZE [findfile $base_dir/size] -+ set SIZE [findfile $base_dir/../../binutils/size] - } - - if ![info exists SIZEFLAGS] then { diff --git a/toolchain/binutils/patches/2.39/050-PowerPC64-pcrel-got-relocs-against-local-symbols.patch b/toolchain/binutils/patches/2.39/050-PowerPC64-pcrel-got-relocs-against-local-symbols.patch deleted file mode 100644 index 5c89f6804e..0000000000 --- a/toolchain/binutils/patches/2.39/050-PowerPC64-pcrel-got-relocs-against-local-symbols.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 4d7bba23a39fba18d6d13a2941a3c232011a7064 Mon Sep 17 00:00:00 2001 -From: Alan Modra <amodra@gmail.com> -Date: Fri, 16 Sep 2022 18:08:44 +0930 -Subject: [PATCH 050/160] PowerPC64 pcrel got relocs against local symbols - -Not that anyone would want to indirect via the GOT when an address can -be loaded directly with pla, the following: - - pld 3,x@got@pcrel -x: - -leads to "Internal error in md_apply_fix", because the generic parts -of assembler fixup handling convert the fx_pcrel fixup to one without -a symbol. Stop that happening. - - * config/tc-ppc.c (ppc_force_relocation): Add PLT_PCREL34 and - assorted GOT_PCREL34 relocs. - -(cherry picked from commit 49c3ed081fed6b8e2b48fdc48f805f11e4589514) ---- - gas/config/tc-ppc.c | 6 ++++++ - 1 file changed, 6 insertions(+) - ---- a/gas/config/tc-ppc.c -+++ b/gas/config/tc-ppc.c -@@ -6676,6 +6676,12 @@ ppc_force_relocation (fixS *fix) - case BFD_RELOC_PPC_BA16_BRNTAKEN: - case BFD_RELOC_24_PLT_PCREL: - case BFD_RELOC_PPC64_TOC: -+ case BFD_RELOC_PPC64_PLT_PCREL34: -+ case BFD_RELOC_PPC64_GOT_PCREL34: -+ case BFD_RELOC_PPC64_GOT_TLSGD_PCREL34: -+ case BFD_RELOC_PPC64_GOT_TLSLD_PCREL34: -+ case BFD_RELOC_PPC64_GOT_TPREL_PCREL34: -+ case BFD_RELOC_PPC64_GOT_DTPREL_PCREL34: - return 1; - case BFD_RELOC_PPC_B26: - case BFD_RELOC_PPC_BA26: diff --git a/toolchain/binutils/patches/2.39/055-Re-PowerPC64-pcrel-got-relocs-against-local-symbols.patch b/toolchain/binutils/patches/2.39/055-Re-PowerPC64-pcrel-got-relocs-against-local-symbols.patch deleted file mode 100644 index 19b80c3442..0000000000 --- a/toolchain/binutils/patches/2.39/055-Re-PowerPC64-pcrel-got-relocs-against-local-symbols.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 010db38b54b589ca3e95b498aba2831064970171 Mon Sep 17 00:00:00 2001 -From: Alan Modra <amodra@gmail.com> -Date: Wed, 21 Sep 2022 09:06:29 +0930 -Subject: [PATCH 055/160] Re: PowerPC64 pcrel got relocs against local symbols - -The last patch wasn't all that shiny. There are rather a lot more -relocations that can hit the assertion in md_apply_fix if the symbol -is local or absolute. Fix them all. - - * config/tc-ppc.c (ppc_force_relocation): Add all relocs that - expect a symbol in md_apply_fix. Remove tls pcrel relocs - already covered in general tls match range. - -(cherry picked from commit 8b168f1a1e09e337d2a970f204a0230c091bbe58) ---- - gas/config/tc-ppc.c | 58 ++++++++++++++++++++++++++++++++++++++++----- - 1 file changed, 52 insertions(+), 6 deletions(-) - ---- a/gas/config/tc-ppc.c -+++ b/gas/config/tc-ppc.c -@@ -6666,8 +6666,6 @@ ppc_force_relocation (fixS *fix) - int - ppc_force_relocation (fixS *fix) - { -- /* Branch prediction relocations must force a relocation, as must -- the vtable description relocs. */ - switch (fix->fx_r_type) - { - case BFD_RELOC_PPC_B16_BRTAKEN: -@@ -6676,12 +6674,60 @@ ppc_force_relocation (fixS *fix) - case BFD_RELOC_PPC_BA16_BRNTAKEN: - case BFD_RELOC_24_PLT_PCREL: - case BFD_RELOC_PPC64_TOC: -+ case BFD_RELOC_16_GOTOFF: -+ case BFD_RELOC_LO16_GOTOFF: -+ case BFD_RELOC_HI16_GOTOFF: -+ case BFD_RELOC_HI16_S_GOTOFF: -+ case BFD_RELOC_LO16_PLTOFF: -+ case BFD_RELOC_HI16_PLTOFF: -+ case BFD_RELOC_HI16_S_PLTOFF: -+ case BFD_RELOC_GPREL16: -+ case BFD_RELOC_16_BASEREL: -+ case BFD_RELOC_LO16_BASEREL: -+ case BFD_RELOC_HI16_BASEREL: -+ case BFD_RELOC_HI16_S_BASEREL: -+ case BFD_RELOC_PPC_TOC16: -+ case BFD_RELOC_PPC64_TOC16_LO: -+ case BFD_RELOC_PPC64_TOC16_HI: -+ case BFD_RELOC_PPC64_TOC16_HA: -+ case BFD_RELOC_PPC64_PLTGOT16: -+ case BFD_RELOC_PPC64_PLTGOT16_LO: -+ case BFD_RELOC_PPC64_PLTGOT16_HI: -+ case BFD_RELOC_PPC64_PLTGOT16_HA: -+ case BFD_RELOC_PPC64_GOT16_DS: -+ case BFD_RELOC_PPC64_GOT16_LO_DS: -+ case BFD_RELOC_PPC64_PLT16_LO_DS: -+ case BFD_RELOC_PPC64_SECTOFF_DS: -+ case BFD_RELOC_PPC64_SECTOFF_LO_DS: -+ case BFD_RELOC_PPC64_TOC16_DS: -+ case BFD_RELOC_PPC64_TOC16_LO_DS: -+ case BFD_RELOC_PPC64_PLTGOT16_DS: -+ case BFD_RELOC_PPC64_PLTGOT16_LO_DS: -+ case BFD_RELOC_PPC_EMB_NADDR16: -+ case BFD_RELOC_PPC_EMB_NADDR16_LO: -+ case BFD_RELOC_PPC_EMB_NADDR16_HI: -+ case BFD_RELOC_PPC_EMB_NADDR16_HA: -+ case BFD_RELOC_PPC_EMB_SDAI16: -+ case BFD_RELOC_PPC_EMB_SDA2I16: -+ case BFD_RELOC_PPC_EMB_SDA2REL: -+ case BFD_RELOC_PPC_EMB_SDA21: -+ case BFD_RELOC_PPC_EMB_MRKREF: -+ case BFD_RELOC_PPC_EMB_RELSEC16: -+ case BFD_RELOC_PPC_EMB_RELST_LO: -+ case BFD_RELOC_PPC_EMB_RELST_HI: -+ case BFD_RELOC_PPC_EMB_RELST_HA: -+ case BFD_RELOC_PPC_EMB_BIT_FLD: -+ case BFD_RELOC_PPC_EMB_RELSDA: -+ case BFD_RELOC_PPC_VLE_SDA21: -+ case BFD_RELOC_PPC_VLE_SDA21_LO: -+ case BFD_RELOC_PPC_VLE_SDAREL_LO16A: -+ case BFD_RELOC_PPC_VLE_SDAREL_LO16D: -+ case BFD_RELOC_PPC_VLE_SDAREL_HI16A: -+ case BFD_RELOC_PPC_VLE_SDAREL_HI16D: -+ case BFD_RELOC_PPC_VLE_SDAREL_HA16A: -+ case BFD_RELOC_PPC_VLE_SDAREL_HA16D: - case BFD_RELOC_PPC64_PLT_PCREL34: - case BFD_RELOC_PPC64_GOT_PCREL34: -- case BFD_RELOC_PPC64_GOT_TLSGD_PCREL34: -- case BFD_RELOC_PPC64_GOT_TLSLD_PCREL34: -- case BFD_RELOC_PPC64_GOT_TPREL_PCREL34: -- case BFD_RELOC_PPC64_GOT_DTPREL_PCREL34: - return 1; - case BFD_RELOC_PPC_B26: - case BFD_RELOC_PPC_BA26: diff --git a/toolchain/binutils/patches/2.39/058-elf-Reset-alignment-for-each-PT_LOAD-segment.patch b/toolchain/binutils/patches/2.39/058-elf-Reset-alignment-for-each-PT_LOAD-segment.patch deleted file mode 100644 index aaf7a1b053..0000000000 --- a/toolchain/binutils/patches/2.39/058-elf-Reset-alignment-for-each-PT_LOAD-segment.patch +++ /dev/null @@ -1,89 +0,0 @@ -From a98316d5cf970cbc99689797d84c2ea832bcdcbb Mon Sep 17 00:00:00 2001 -From: "H.J. Lu" <hjl.tools@gmail.com> -Date: Mon, 1 Aug 2022 16:02:39 -0700 -Subject: [PATCH 058/160] elf: Reset alignment for each PT_LOAD segment - -Reset alignment for each PT_LOAD segment to avoid using alignment from -the previous PT_LOAD segment. - -bfd/ - - PR ld/29435 - * elf.c (assign_file_positions_for_load_sections): Reset - alignment for each PT_LOAD segment. - -ld/ - - PR ld/29435 - * testsuite/ld-elf/pr29435.d: New file. - * testsuite/ld-elf/pr29435.s: Likewise. - -(cherry picked from commit 59f214544c50ec7ebbca285ff2b4949f48671690) ---- - bfd/elf.c | 7 ++++--- - ld/testsuite/ld-elf/pr29435.d | 11 +++++++++++ - ld/testsuite/ld-elf/pr29435.s | 6 ++++++ - 3 files changed, 21 insertions(+), 3 deletions(-) - create mode 100644 ld/testsuite/ld-elf/pr29435.d - create mode 100644 ld/testsuite/ld-elf/pr29435.s - ---- a/bfd/elf.c -+++ b/bfd/elf.c -@@ -5438,8 +5438,6 @@ assign_file_positions_for_load_sections - Elf_Internal_Phdr *p; - file_ptr off; /* Octets. */ - bfd_size_type maxpagesize; -- bfd_size_type p_align; -- bool p_align_p = false; - unsigned int alloc, actual; - unsigned int i, j; - struct elf_segment_map **sorted_seg_map; -@@ -5524,7 +5522,6 @@ assign_file_positions_for_load_sections - qsort (sorted_seg_map, alloc, sizeof (*sorted_seg_map), - elf_sort_segments); - -- p_align = bed->p_align; - maxpagesize = 1; - if ((abfd->flags & D_PAGED) != 0) - { -@@ -5559,6 +5556,8 @@ assign_file_positions_for_load_sections - asection **secpp; - bfd_vma off_adjust; /* Octets. */ - bool no_contents; -+ bfd_size_type p_align; -+ bool p_align_p; - - /* An ELF segment (described by Elf_Internal_Phdr) may contain a - number of sections with contents contributing to both p_filesz -@@ -5569,6 +5568,8 @@ assign_file_positions_for_load_sections - p = phdrs + m->idx; - p->p_type = m->p_type; - p->p_flags = m->p_flags; -+ p_align = bed->p_align; -+ p_align_p = false; - - if (m->count == 0) - p->p_vaddr = m->p_vaddr_offset * opb; ---- /dev/null -+++ b/ld/testsuite/ld-elf/pr29435.d -@@ -0,0 +1,11 @@ -+#ld: -shared -z separate-code -z relro -+#xfail: ![check_shared_lib_support] -+#xfail: ![check_relro_support] -+#readelf: -Wl -+ -+#failif -+#... -+ +LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ .* 0x8000 -+#... -+ +LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ .* 0x8000 -+#... ---- /dev/null -+++ b/ld/testsuite/ld-elf/pr29435.s -@@ -0,0 +1,6 @@ -+ .text -+ .balign 0x8000 -+ .globl foo -+ .type foo, %function -+foo: -+ .byte 0 diff --git a/toolchain/binutils/patches/2.39/063-PR29542-PowerPC-gold-internal-error-in-get_output_vi.patch b/toolchain/binutils/patches/2.39/063-PR29542-PowerPC-gold-internal-error-in-get_output_vi.patch deleted file mode 100644 index 0d66b7750f..0000000000 --- a/toolchain/binutils/patches/2.39/063-PR29542-PowerPC-gold-internal-error-in-get_output_vi.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 041c22e35de06d22566f4c71e4425c3351215e66 Mon Sep 17 00:00:00 2001 -From: Alan Modra <amodra@gmail.com> -Date: Sun, 25 Sep 2022 12:07:36 +0930 -Subject: [PATCH 063/160] PR29542, PowerPC gold internal error in - get_output_view, - -We were attempting to set a BSS style section contents. - - PR 29542 - * powerpc.cc (Output_data_plt_powerpc::do_write): Don't set .plt, - .iplt or .lplt section contents when position independent. - -(cherry picked from commit c21736aed1d4877e090df60362413669dbdc391d) ---- - gold/powerpc.cc | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/gold/powerpc.cc -+++ b/gold/powerpc.cc -@@ -4338,7 +4338,8 @@ template<int size, bool big_endian> - void - Output_data_plt_powerpc<size, big_endian>::do_write(Output_file* of) - { -- if (!this->sym_ents_.empty()) -+ if (!this->sym_ents_.empty() -+ && !parameters->options().output_is_position_independent()) - { - const section_size_type offset = this->offset(); - const section_size_type oview_size diff --git a/toolchain/binutils/patches/2.39/116-arm-Use-DWARF-numbering-convention-for-pseudo-regist.patch b/toolchain/binutils/patches/2.39/116-arm-Use-DWARF-numbering-convention-for-pseudo-regist.patch deleted file mode 100644 index 82a015ee2b..0000000000 --- a/toolchain/binutils/patches/2.39/116-arm-Use-DWARF-numbering-convention-for-pseudo-regist.patch +++ /dev/null @@ -1,301 +0,0 @@ -From 88ac930a725b8aac8284a2738f03b843f4343dd0 Mon Sep 17 00:00:00 2001 -From: Victor Do Nascimento <Victor.DoNascimento@arm.com> -Date: Thu, 17 Nov 2022 14:48:37 +0000 -Subject: [PATCH 116/160] arm: Use DWARF numbering convention for - pseudo-register representation - -The patch, initially submitted to trunk in -https://sourceware.org/pipermail/binutils/2022-July/122092.html ensures correct -support for handling .save directives for mixed-register type lists involving -the ra_auth_code pseudo-register, whereby the support first introduced in 2.39 -(https://sourceware.org/pipermail/binutils/2022-May/120672.html) led to the -generation of unwinder code popping registers in reversed order. - -gas/Changelog: - - * config/tc-arm.c (REG_RA_AUTH_CODE): New. - (parse_dot_save): Likewise. - (parse_reg_list): Remove obsolete code. - (reg_names): Set ra_auth_code to 143. - (s_arm_unwind_save): Handle core and pseudo-register lists via - parse_dot_save. - (s_arm_unwind_save_mixed): Deleted. - (s_arm_unwind_save_pseudo): Handle one register at a time. - * testsuite/gas/arm/unwind-pacbti-m-readelf.d: Fix test. - * testsuite/gas/arm/unwind-pacbti-m.d: Likewise. - -(cherry picked from commit 3a368c4c248f6e9f4bda3a5369befa17a4560293) ---- - gas/config/tc-arm.c | 159 ++++++++++-------- - .../gas/arm/unwind-pacbti-m-readelf.d | 4 +- - gas/testsuite/gas/arm/unwind-pacbti-m.d | 2 +- - 3 files changed, 95 insertions(+), 70 deletions(-) - ---- a/gas/config/tc-arm.c -+++ b/gas/config/tc-arm.c -@@ -742,6 +742,7 @@ const char * const reg_expected_msgs[] = - #define REG_SP 13 - #define REG_LR 14 - #define REG_PC 15 -+#define REG_RA_AUTH_CODE 143 - - /* ARM instructions take 4bytes in the object file, Thumb instructions - take 2: */ -@@ -1943,21 +1944,6 @@ parse_reg_list (char ** strp, enum reg_l - - reg = arm_reg_parse (&str, rt); - -- /* Skip over allowed registers of alternative types in mixed-type -- register lists. */ -- if (reg == FAIL && rt == REG_TYPE_PSEUDO -- && ((reg = arm_reg_parse (&str, REG_TYPE_RN)) != FAIL)) -- { -- cur_reg = reg; -- continue; -- } -- else if (reg == FAIL && rt == REG_TYPE_RN -- && ((reg = arm_reg_parse (&str, REG_TYPE_PSEUDO)) != FAIL)) -- { -- cur_reg = reg; -- continue; -- } -- - if (etype == REGLIST_CLRM) - { - if (reg == REG_SP || reg == REG_PC) -@@ -4139,7 +4125,6 @@ s_arm_unwind_fnstart (int ignored ATTRIB - unwind.sp_restored = 0; - } - -- - /* Parse a handlerdata directive. Creates the exception handling table entry - for the function. */ - -@@ -4297,15 +4282,19 @@ s_arm_unwind_personality (int ignored AT - /* Parse a directive saving pseudo registers. */ - - static void --s_arm_unwind_save_pseudo (long range) -+s_arm_unwind_save_pseudo (int regno) - { - valueT op; - -- if (range & (1 << 12)) -+ switch (regno) - { -+ case REG_RA_AUTH_CODE: - /* Opcode for restoring RA_AUTH_CODE. */ - op = 0xb4; - add_unwind_opcode (op, 1); -+ break; -+ default: -+ as_bad (_("Unknown register %d encountered\n"), regno); - } - } - -@@ -4375,6 +4364,80 @@ s_arm_unwind_save_core (long range) - } - } - -+/* Implement correct handling of .save lists enabling the split into -+sublists where necessary, while preserving correct sublist ordering. */ -+ -+static void -+parse_dot_save (char **str_p, int prev_reg) -+{ -+ long core_regs = 0; -+ int reg; -+ int in_range = 0; -+ -+ if (**str_p == ',') -+ *str_p += 1; -+ if (**str_p == '}') -+ { -+ *str_p += 1; -+ return; -+ } -+ -+ while ((reg = arm_reg_parse (str_p, REG_TYPE_RN)) != FAIL) -+ { -+ if (!in_range) -+ { -+ if (core_regs & (1 << reg)) -+ as_tsktsk (_("Warning: duplicated register (r%d) in register list"), -+ reg); -+ else if (reg <= prev_reg) -+ as_tsktsk (_("Warning: register list not in ascending order")); -+ -+ core_regs |= (1 << reg); -+ prev_reg = reg; -+ if (skip_past_char(str_p, '-') != FAIL) -+ in_range = 1; -+ else if (skip_past_comma(str_p) == FAIL) -+ first_error (_("bad register list")); -+ } -+ else -+ { -+ int i; -+ if (reg <= prev_reg) -+ first_error (_("bad range in register list")); -+ for (i = prev_reg + 1; i <= reg; i++) -+ { -+ if (core_regs & (1 << i)) -+ as_tsktsk (_("Warning: duplicated register (r%d) in register list"), -+ i); -+ else -+ core_regs |= 1 << i; -+ } -+ in_range = 0; -+ } -+ } -+ if (core_regs) -+ { -+ /* Higher register numbers go in higher memory addresses. When splitting a list, -+ right-most sublist should therefore be .saved first. Use recursion for this. */ -+ parse_dot_save (str_p, reg); -+ /* We're back from recursion, so emit .save insn for sublist. */ -+ s_arm_unwind_save_core (core_regs); -+ return; -+ } -+ /* Handle pseudo-regs, under assumption these are emitted singly. */ -+ else if ((reg = arm_reg_parse (str_p, REG_TYPE_PSEUDO)) != FAIL) -+ { -+ /* Recurse for remainder of input. Note: No assumption is made regarding which -+ register in core register set holds pseudo-register. It's not considered in -+ ordering check beyond ensuring it's not sandwiched between 2 consecutive -+ registers. */ -+ parse_dot_save (str_p, prev_reg + 1); -+ s_arm_unwind_save_pseudo (reg); -+ return; -+ } -+ else -+ as_bad (BAD_SYNTAX); -+} - - /* Parse a directive saving FPA registers. */ - -@@ -4716,39 +4779,13 @@ s_arm_unwind_save_mmxwcg (void) - ignore_rest_of_line (); - } - --/* Convert range and mask_range into a sequence of s_arm_unwind_core -- and s_arm_unwind_pseudo operations. We assume that mask_range will -- not have consecutive bits set, or that one operation per bit is -- acceptable. */ -- --static void --s_arm_unwind_save_mixed (long range, long mask_range) --{ -- while (mask_range) -- { -- long mask_bit = mask_range & -mask_range; -- long subrange = range & (mask_bit - 1); -- -- if (subrange) -- s_arm_unwind_save_core (subrange); -- -- s_arm_unwind_save_pseudo (mask_bit); -- range &= ~subrange; -- mask_range &= ~mask_bit; -- } -- -- if (range) -- s_arm_unwind_save_core (range); --} -- - /* Parse an unwind_save directive. - If the argument is non-zero, this is a .vsave directive. */ - - static void - s_arm_unwind_save (int arch_v6) - { -- char *peek, *mask_peek; -- long range, mask_range; -+ char *peek; - struct reg_entry *reg; - bool had_brace = false; - -@@ -4756,7 +4793,7 @@ s_arm_unwind_save (int arch_v6) - as_bad (MISSING_FNSTART); - - /* Figure out what sort of save we have. */ -- peek = mask_peek = input_line_pointer; -+ peek = input_line_pointer; - - if (*peek == '{') - { -@@ -4788,20 +4825,13 @@ s_arm_unwind_save (int arch_v6) - - case REG_TYPE_PSEUDO: - case REG_TYPE_RN: -- mask_range = parse_reg_list (&mask_peek, REGLIST_PSEUDO); -- range = parse_reg_list (&input_line_pointer, REGLIST_RN); -- -- if (range == FAIL || mask_range == FAIL) -- { -- as_bad (_("expected register list")); -- ignore_rest_of_line (); -- return; -- } -- -- demand_empty_rest_of_line (); -- -- s_arm_unwind_save_mixed (range, mask_range); -- return; -+ { -+ if (had_brace) -+ input_line_pointer++; -+ parse_dot_save (&input_line_pointer, -1); -+ demand_empty_rest_of_line (); -+ return; -+ } - - case REG_TYPE_VFD: - if (arch_v6) -@@ -23993,12 +24023,8 @@ static const struct reg_entry reg_names[ - /* XScale accumulator registers. */ - REGNUM(acc,0,XSCALE), REGNUM(ACC,0,XSCALE), - -- /* DWARF ABI defines RA_AUTH_CODE to 143. It also reserves 134-142 for future -- expansion. RA_AUTH_CODE here is given the value 143 % 134 to make it easy -- for tc_arm_regname_to_dw2regnum to translate to DWARF reg number using -- 134 + reg_number should the range 134 to 142 be used for more pseudo regs -- in the future. This also helps fit RA_AUTH_CODE into a bitmask. */ -- REGDEF(ra_auth_code,12,PSEUDO), -+ /* AADWARF32 defines RA_AUTH_CODE to 143. */ -+ REGDEF(ra_auth_code,143,PSEUDO), - }; - #undef REGDEF - #undef REGNUM -@@ -27905,7 +27931,6 @@ create_unwind_entry (int have_data) - return 0; - } - -- - /* Initialize the DWARF-2 unwind information for this procedure. */ - - void ---- a/gas/testsuite/gas/arm/unwind-pacbti-m-readelf.d -+++ b/gas/testsuite/gas/arm/unwind-pacbti-m-readelf.d -@@ -10,11 +10,11 @@ Unwind section '.ARM.exidx' at offset 0x - - 0x0 <foo>: @0x0 - Compact model index: 1 -- 0x84 0x00 pop {r14} - 0xb4 pop {ra_auth_code} - 0x84 0x00 pop {r14} -- 0xb4 pop {ra_auth_code} - 0xa3 pop {r4, r5, r6, r7} - 0xb4 pop {ra_auth_code} -+ 0x84 0x00 pop {r14} -+ 0xb4 pop {ra_auth_code} - 0xa8 pop {r4, r14} - 0xb0 finish ---- a/gas/testsuite/gas/arm/unwind-pacbti-m.d -+++ b/gas/testsuite/gas/arm/unwind-pacbti-m.d -@@ -8,4 +8,4 @@ - .*: file format.* - - Contents of section .ARM.extab: -- 0000 (00840281 b40084b4 b0a8b4a3|81028400 b48400b4 a3b4a8b0) 00000000 .* -+ 0000 (84b40281 84b4a300 b0a8b400|8102b484 00a3b484 00b4a8b0) 00000000 .* diff --git a/toolchain/binutils/patches/2.40/001-PR-30569-always-call-elf_backend_size_dynamic_sectio.patch b/toolchain/binutils/patches/2.40/001-PR-30569-always-call-elf_backend_size_dynamic_sectio.patch deleted file mode 100644 index 9c7635df44..0000000000 --- a/toolchain/binutils/patches/2.40/001-PR-30569-always-call-elf_backend_size_dynamic_sectio.patch +++ /dev/null @@ -1,2172 +0,0 @@ -From af969b14aedcc0ae27dcefab4327ff2d153dec8b Mon Sep 17 00:00:00 2001 -From: Alan Modra <amodra@gmail.com> -Date: Thu, 28 Mar 2024 19:25:42 +1030 -Subject: [PATCH 1/2] PR 30569, always call elf_backend_size_dynamic_sections - -This largely mechanical patch is preparation for a followup patch. - -For quite some time I've thought that it would be useful to call -elf_backend_size_dynamic_sections even when no dynamic objects are -seen by the linker. That's what this patch does, with some renaming. -There are no functional changes to the linker, just a move of the -dynobj test in bfd_elf_size_dynamic_sections to target backend -functions, replacing the asserts/aborts already there. No doubt some -of the current always_size_sections functions could be moved to -size_dynamic_sections but I haven't made that change. - -Because both hooks are now always called, I have renamed -always_size_sections to early_size_sections and size_dynamic_sections -to late_size_sections. I condisdered calling late_size_sections plain -size_sections, since this is the usual target dynamic section sizing -hook, but decided that searching the sources for "size_sections" would -then hit early_size_sections and other functions. ---- - bfd/elf-bfd.h | 35 +++++++++++++++++------------------ - bfd/elf-m10300.c | 11 ++++++----- - bfd/elf32-arc.c | 9 +++++---- - bfd/elf32-arm.c | 15 ++++++++------- - bfd/elf32-bfin.c | 31 ++++++++++++++++--------------- - bfd/elf32-cr16.c | 11 ++++++----- - bfd/elf32-cris.c | 13 +++++++------ - bfd/elf32-csky.c | 8 ++++---- - bfd/elf32-frv.c | 23 ++++++++++++----------- - bfd/elf32-hppa.c | 8 ++++---- - bfd/elf32-i386.c | 7 +++---- - bfd/elf32-lm32.c | 15 ++++++++------- - bfd/elf32-m32c.c | 8 ++++---- - bfd/elf32-m32r.c | 11 ++++++----- - bfd/elf32-m68k.c | 16 ++++++++-------- - bfd/elf32-metag.c | 8 ++++---- - bfd/elf32-microblaze.c | 9 +++++---- - bfd/elf32-mips.c | 6 ++---- - bfd/elf32-nds32.c | 9 +++++---- - bfd/elf32-nios2.c | 15 ++++++++------- - bfd/elf32-or1k.c | 9 +++++---- - bfd/elf32-ppc.c | 11 ++++++----- - bfd/elf32-rl78.c | 8 ++++---- - bfd/elf32-s390.c | 10 +++++----- - bfd/elf32-score.c | 35 ++++++++++++++++++----------------- - bfd/elf32-score.h | 4 ++-- - bfd/elf32-score7.c | 13 +++++++------ - bfd/elf32-sh.c | 15 +++++++-------- - bfd/elf32-sparc.c | 3 +-- - bfd/elf32-tic6x.c | 14 +++++++------- - bfd/elf32-tilegx.c | 2 +- - bfd/elf32-tilepro.c | 11 +++++------ - bfd/elf32-vax.c | 16 +++++++--------- - bfd/elf32-xstormy16.c | 8 ++++---- - bfd/elf32-xtensa.c | 13 ++++++------- - bfd/elf64-alpha.c | 19 ++++++++++--------- - bfd/elf64-hppa.c | 11 ++++------- - bfd/elf64-ia64-vms.c | 13 +++++++------ - bfd/elf64-mips.c | 8 ++++---- - bfd/elf64-ppc.c | 12 ++++++------ - bfd/elf64-s390.c | 10 +++++----- - bfd/elf64-sparc.c | 4 ++-- - bfd/elf64-tilegx.c | 2 +- - bfd/elf64-x86-64.c | 7 +++---- - bfd/elflink.c | 9 ++++----- - bfd/elfn32-mips.c | 6 ++---- - bfd/elfnn-aarch64.c | 21 +++++++++++---------- - bfd/elfnn-ia64.c | 11 ++++++----- - bfd/elfnn-kvx.c | 19 +++++++++---------- - bfd/elfnn-loongarch.c | 9 +++++---- - bfd/elfnn-riscv.c | 7 ++++--- - bfd/elfxx-mips.c | 15 ++++++++------- - bfd/elfxx-mips.h | 4 ++-- - bfd/elfxx-sparc.c | 7 ++++--- - bfd/elfxx-sparc.h | 2 +- - bfd/elfxx-target.h | 12 ++++++------ - bfd/elfxx-tilegx.c | 7 ++++--- - bfd/elfxx-tilegx.h | 2 +- - bfd/elfxx-x86.c | 8 ++++---- - bfd/elfxx-x86.h | 8 ++++---- - ld/emultempl/vms.em | 7 +++---- - 61 files changed, 343 insertions(+), 337 deletions(-) - ---- a/bfd/elf-bfd.h -+++ b/bfd/elf-bfd.h -@@ -1173,7 +1173,7 @@ struct elf_backend_data - /* The ADJUST_DYNAMIC_SYMBOL function is called by the ELF backend - linker for every symbol which is defined by a dynamic object and - referenced by a regular object. This is called after all the -- input files have been seen, but before the SIZE_DYNAMIC_SECTIONS -+ input files have been seen, but before the LATE_SIZE_SECTIONS - function has been called. The hash table entry should be - bfd_link_hash_defined ore bfd_link_hash_defweak, and it should be - defined in a section from a dynamic object. Dynamic object -@@ -1185,24 +1185,23 @@ struct elf_backend_data - bool (*elf_backend_adjust_dynamic_symbol) - (struct bfd_link_info *info, struct elf_link_hash_entry *h); - -- /* The ALWAYS_SIZE_SECTIONS function is called by the backend linker -- after all the linker input files have been seen but before the -- section sizes have been set. This is called after -- ADJUST_DYNAMIC_SYMBOL, but before SIZE_DYNAMIC_SECTIONS. */ -- bool (*elf_backend_always_size_sections) -+ /* The EARLY_SIZE_SECTIONS and LATE_SIZE_SECTIONS functions are -+ called by the backend linker after all linker input files have -+ been seen and sections have been assigned to output sections, but -+ before the section sizes have been set. Both of these functions -+ are called even when no dynamic object is seen by the linker. -+ Between them, they must set the sizes of the dynamic sections and -+ other backend specific sections, and may fill in their contents. -+ Most backends need only use LATE_SIZE_SECTIONS. -+ EARLY_SIZE_SECTIONS is called before --export-dynamic makes some -+ symbols dynamic and before ADJUST_DYNAMIC_SYMBOL processes -+ dynamic symbols, LATE_SIZE_SECTIONS afterwards. The generic ELF -+ linker can handle the .dynsym, .dynstr and .hash sections. -+ Besides those, these functions must handle the .interp section -+ and any other sections created by CREATE_DYNAMIC_SECTIONS. */ -+ bool (*elf_backend_early_size_sections) - (bfd *output_bfd, struct bfd_link_info *info); -- -- /* The SIZE_DYNAMIC_SECTIONS function is called by the ELF backend -- linker after all the linker input files have been seen but before -- the sections sizes have been set. This is called after -- ADJUST_DYNAMIC_SYMBOL has been called on all appropriate symbols. -- It is only called when linking against a dynamic object. It must -- set the sizes of the dynamic sections, and may fill in their -- contents as well. The generic ELF linker can handle the .dynsym, -- .dynstr and .hash sections. This function must handle the -- .interp section and any sections created by the -- CREATE_DYNAMIC_SECTIONS entry point. */ -- bool (*elf_backend_size_dynamic_sections) -+ bool (*elf_backend_late_size_sections) - (bfd *output_bfd, struct bfd_link_info *info); - - /* The STRIP_ZERO_SIZED_DYNAMIC_SECTIONS function is called by the ---- a/bfd/elf-m10300.c -+++ b/bfd/elf-m10300.c -@@ -5012,8 +5012,8 @@ _bfd_mn10300_elf_adjust_dynamic_symbol ( - /* Set the sizes of the dynamic sections. */ - - static bool --_bfd_mn10300_elf_size_dynamic_sections (bfd * output_bfd, -- struct bfd_link_info * info) -+_bfd_mn10300_elf_late_size_sections (bfd * output_bfd, -+ struct bfd_link_info * info) - { - struct elf32_mn10300_link_hash_table *htab = elf32_mn10300_hash_table (info); - bfd * dynobj; -@@ -5021,7 +5021,8 @@ _bfd_mn10300_elf_size_dynamic_sections ( - bool relocs; - - dynobj = htab->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -5508,8 +5509,8 @@ mn10300_elf_mkobject (bfd *abfd) - _bfd_mn10300_elf_create_dynamic_sections - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mn10300_elf_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections \ -- _bfd_mn10300_elf_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ _bfd_mn10300_elf_late_size_sections - #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all - #define elf_backend_finish_dynamic_symbol \ - _bfd_mn10300_elf_finish_dynamic_symbol ---- a/bfd/elf32-arc.c -+++ b/bfd/elf32-arc.c -@@ -2702,8 +2702,8 @@ elf_arc_finish_dynamic_sections (bfd * o - - /* Set the sizes of the dynamic sections. */ - static bool --elf_arc_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_arc_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; -@@ -2711,7 +2711,8 @@ elf_arc_size_dynamic_sections (bfd *outp - struct elf_link_hash_table *htab = elf_hash_table (info); - - dynobj = htab->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->dynamic_sections_created) - { -@@ -3126,7 +3127,7 @@ arc_elf_relax_section (bfd *abfd, asecti - #define elf_backend_finish_dynamic_symbol elf_arc_finish_dynamic_symbol - - #define elf_backend_finish_dynamic_sections elf_arc_finish_dynamic_sections --#define elf_backend_size_dynamic_sections elf_arc_size_dynamic_sections -+#define elf_backend_late_size_sections elf_arc_late_size_sections - - #define elf_backend_can_gc_sections 1 - #define elf_backend_want_got_plt 1 ---- a/bfd/elf32-arm.c -+++ b/bfd/elf32-arm.c -@@ -16734,8 +16734,8 @@ bfd_elf32_arm_set_byteswap_code (struct - /* Set the sizes of the dynamic sections. */ - - static bool --elf32_arm_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info * info) -+elf32_arm_late_size_sections (bfd * output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info * info) - { - bfd * dynobj; - asection * s; -@@ -16748,7 +16748,9 @@ elf32_arm_size_dynamic_sections (bfd * o - return false; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; -+ - check_use_blx (htab); - - if (elf_hash_table (info)->dynamic_sections_created) -@@ -17120,8 +17122,7 @@ elf32_arm_size_dynamic_sections (bfd * o - _TLS_MODULE_BASE_, if needed. */ - - static bool --elf32_arm_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf32_arm_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - asection *tls_sec; - struct elf32_arm_link_hash_table *htab; -@@ -20320,8 +20321,8 @@ elf32_arm_backend_symbol_processing (bfd - #define elf_backend_create_dynamic_sections elf32_arm_create_dynamic_sections - #define elf_backend_finish_dynamic_symbol elf32_arm_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections elf32_arm_finish_dynamic_sections --#define elf_backend_size_dynamic_sections elf32_arm_size_dynamic_sections --#define elf_backend_always_size_sections elf32_arm_always_size_sections -+#define elf_backend_late_size_sections elf32_arm_late_size_sections -+#define elf_backend_early_size_sections elf32_arm_early_size_sections - #define elf_backend_init_index_section _bfd_elf_init_2_index_sections - #define elf_backend_init_file_header elf32_arm_init_file_header - #define elf_backend_reloc_type_class elf32_arm_reloc_type_class ---- a/bfd/elf32-bfin.c -+++ b/bfd/elf32-bfin.c -@@ -4027,8 +4027,8 @@ _bfinfdpic_size_got_plt (bfd *output_bfd - /* Set the sizes of the dynamic sections. */ - - static bool --elf32_bfinfdpic_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf32_bfinfdpic_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - struct elf_link_hash_table *htab; - bfd *dynobj; -@@ -4037,7 +4037,8 @@ elf32_bfinfdpic_size_dynamic_sections (b - - htab = elf_hash_table (info); - dynobj = htab->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->dynamic_sections_created) - { -@@ -4086,7 +4087,7 @@ elf32_bfinfdpic_size_dynamic_sections (b - } - - static bool --elf32_bfinfdpic_always_size_sections (bfd *output_bfd, -+elf32_bfinfdpic_early_size_sections (bfd *output_bfd, - struct bfd_link_info *info) - { - if (!bfd_link_relocatable (info) -@@ -5124,15 +5125,16 @@ bfin_discard_copies (struct elf_link_has - } - - static bool --bfin_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+bfin_late_size_sections (bfd * output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; - bool relocs; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -5424,8 +5426,7 @@ struct bfd_elf_special_section const elf - #define elf_backend_check_relocs bfin_check_relocs - #define elf_backend_adjust_dynamic_symbol \ - bfin_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections \ -- bfin_size_dynamic_sections -+#define elf_backend_late_size_sections bfin_late_size_sections - #define elf_backend_relocate_section bfin_relocate_section - #define elf_backend_finish_dynamic_symbol \ - bfin_finish_dynamic_symbol -@@ -5471,9 +5472,9 @@ struct bfd_elf_special_section const elf - #undef bfd_elf32_bfd_link_hash_table_create - #define bfd_elf32_bfd_link_hash_table_create \ - bfinfdpic_elf_link_hash_table_create --#undef elf_backend_always_size_sections --#define elf_backend_always_size_sections \ -- elf32_bfinfdpic_always_size_sections -+#undef elf_backend_early_size_sections -+#define elf_backend_early_size_sections \ -+ elf32_bfinfdpic_early_size_sections - - #undef elf_backend_create_dynamic_sections - #define elf_backend_create_dynamic_sections \ -@@ -5481,9 +5482,9 @@ struct bfd_elf_special_section const elf - #undef elf_backend_adjust_dynamic_symbol - #define elf_backend_adjust_dynamic_symbol \ - elf32_bfinfdpic_adjust_dynamic_symbol --#undef elf_backend_size_dynamic_sections --#define elf_backend_size_dynamic_sections \ -- elf32_bfinfdpic_size_dynamic_sections -+#undef elf_backend_late_size_sections -+#define elf_backend_late_size_sections \ -+ elf32_bfinfdpic_late_size_sections - #undef elf_backend_finish_dynamic_symbol - #define elf_backend_finish_dynamic_symbol \ - elf32_bfinfdpic_finish_dynamic_symbol ---- a/bfd/elf32-cr16.c -+++ b/bfd/elf32-cr16.c -@@ -2390,15 +2390,16 @@ _bfd_cr16_elf_adjust_dynamic_symbol (str - /* Set the sizes of the dynamic sections. */ - - static bool --_bfd_cr16_elf_size_dynamic_sections (bfd * output_bfd, -- struct bfd_link_info * info) -+_bfd_cr16_elf_late_size_sections (bfd * output_bfd, -+ struct bfd_link_info * info) - { - bfd * dynobj; - asection * s; - bool relocs; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -2835,8 +2836,8 @@ _bfd_cr16_elf_reloc_type_class (const st - _bfd_cr16_elf_create_dynamic_sections - #define elf_backend_adjust_dynamic_symbol \ - _bfd_cr16_elf_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections \ -- _bfd_cr16_elf_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ _bfd_cr16_elf_late_size_sections - #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all - #define elf_backend_finish_dynamic_symbol \ - _bfd_cr16_elf_finish_dynamic_symbol ---- a/bfd/elf32-cris.c -+++ b/bfd/elf32-cris.c -@@ -2527,7 +2527,7 @@ cris_elf_plt_sym_val (bfd_vma i ATTRIBUT - entry but we found we will not create any. Called when we find we will - not have any PLT for this symbol, by for example - elf_cris_adjust_dynamic_symbol when we're doing a proper dynamic link, -- or elf_cris_size_dynamic_sections if no dynamic sections will be -+ or elf_cris_late_size_sections if no dynamic sections will be - created (we're only linking static objects). */ - - static bool -@@ -3508,8 +3508,8 @@ cris_elf_check_relocs (bfd *abfd, - /* Set the sizes of the dynamic sections. */ - - static bool --elf_cris_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_cris_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_cris_link_hash_table * htab; - bfd *dynobj; -@@ -3521,7 +3521,8 @@ elf_cris_size_dynamic_sections (bfd *out - return false; - - dynobj = htab->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->root.dynamic_sections_created) - { -@@ -4090,8 +4091,8 @@ elf_cris_got_elt_size (bfd *abfd ATTRIBU - elf_cris_adjust_dynamic_symbol - #define elf_backend_copy_indirect_symbol \ - elf_cris_copy_indirect_symbol --#define elf_backend_size_dynamic_sections \ -- elf_cris_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ elf_cris_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_finish_dynamic_symbol \ - elf_cris_finish_dynamic_symbol ---- a/bfd/elf32-csky.c -+++ b/bfd/elf32-csky.c -@@ -1893,8 +1893,8 @@ csky_allocate_dynrelocs (struct elf_link - /* Set the sizes of the dynamic sections. */ - - static bool --csky_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+csky_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct csky_elf_link_hash_table *htab; - bfd *dynobj; -@@ -1907,7 +1907,7 @@ csky_elf_size_dynamic_sections (bfd *out - return false; - dynobj = htab->elf.dynobj; - if (dynobj == NULL) -- return false; -+ return true; - - if (htab->elf.dynamic_sections_created) - { -@@ -5344,7 +5344,7 @@ elf32_csky_obj_attrs_handle_unknown (bfd - /* Dynamic relocate related API. */ - #define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections - #define elf_backend_adjust_dynamic_symbol csky_elf_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections csky_elf_size_dynamic_sections -+#define elf_backend_late_size_sections csky_elf_late_size_sections - #define elf_backend_finish_dynamic_symbol csky_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections csky_elf_finish_dynamic_sections - #define elf_backend_rela_normal 1 ---- a/bfd/elf32-frv.c -+++ b/bfd/elf32-frv.c -@@ -5423,15 +5423,16 @@ _frvfdpic_size_got_plt (bfd *output_bfd, - /* Set the sizes of the dynamic sections. */ - - static bool --elf32_frvfdpic_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf32_frvfdpic_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; - struct _frvfdpic_dynamic_got_plt_info gpinfo; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -5472,8 +5473,8 @@ elf32_frvfdpic_size_dynamic_sections (bf - } - - static bool --elf32_frvfdpic_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf32_frvfdpic_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - if (!bfd_link_relocatable (info) - && !bfd_elf_stack_segment_size (output_bfd, info, -@@ -6817,9 +6818,9 @@ elf32_frv_grok_psinfo (bfd *abfd, Elf_In - #undef bfd_elf32_bfd_link_hash_table_create - #define bfd_elf32_bfd_link_hash_table_create \ - frvfdpic_elf_link_hash_table_create --#undef elf_backend_always_size_sections --#define elf_backend_always_size_sections \ -- elf32_frvfdpic_always_size_sections -+#undef elf_backend_early_size_sections -+#define elf_backend_early_size_sections \ -+ elf32_frvfdpic_early_size_sections - - #undef elf_backend_create_dynamic_sections - #define elf_backend_create_dynamic_sections \ -@@ -6827,9 +6828,9 @@ elf32_frv_grok_psinfo (bfd *abfd, Elf_In - #undef elf_backend_adjust_dynamic_symbol - #define elf_backend_adjust_dynamic_symbol \ - elf32_frvfdpic_adjust_dynamic_symbol --#undef elf_backend_size_dynamic_sections --#define elf_backend_size_dynamic_sections \ -- elf32_frvfdpic_size_dynamic_sections -+#undef elf_backend_late_size_sections -+#define elf_backend_late_size_sections \ -+ elf32_frvfdpic_late_size_sections - #undef bfd_elf32_bfd_relax_section - #define bfd_elf32_bfd_relax_section \ - elf32_frvfdpic_relax_section ---- a/bfd/elf32-hppa.c -+++ b/bfd/elf32-hppa.c -@@ -2042,8 +2042,8 @@ clobber_millicode_symbols (struct elf_li - /* Set the sizes of the dynamic sections. */ - - static bool --elf32_hppa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf32_hppa_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf32_hppa_link_hash_table *htab; - bfd *dynobj; -@@ -2057,7 +2057,7 @@ elf32_hppa_size_dynamic_sections (bfd *o - - dynobj = htab->etab.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - if (htab->etab.dynamic_sections_created) - { -@@ -4450,7 +4450,7 @@ elf32_hppa_elf_get_symbol_type (Elf_Inte - #define elf_backend_hide_symbol elf32_hppa_hide_symbol - #define elf_backend_finish_dynamic_symbol elf32_hppa_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections elf32_hppa_finish_dynamic_sections --#define elf_backend_size_dynamic_sections elf32_hppa_size_dynamic_sections -+#define elf_backend_late_size_sections elf32_hppa_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_gc_mark_hook elf32_hppa_gc_mark_hook - #define elf_backend_grok_prstatus elf32_hppa_grok_prstatus ---- a/bfd/elf32-i386.c -+++ b/bfd/elf32-i386.c -@@ -1933,8 +1933,7 @@ elf_i386_scan_relocs (bfd *abfd, - } - - static bool --elf_i386_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf_i386_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - bfd *abfd; - -@@ -1947,7 +1946,7 @@ elf_i386_always_size_sections (bfd *outp - elf_i386_scan_relocs)) - return false; - -- return _bfd_x86_elf_always_size_sections (output_bfd, info); -+ return _bfd_x86_elf_early_size_sections (output_bfd, info); - } - - /* Set the correct type for an x86 ELF section. We do this by the -@@ -4444,7 +4443,7 @@ elf_i386_link_setup_gnu_properties (stru - #define bfd_elf32_get_synthetic_symtab elf_i386_get_synthetic_symtab - - #define elf_backend_relocs_compatible _bfd_elf_relocs_compatible --#define elf_backend_always_size_sections elf_i386_always_size_sections -+#define elf_backend_early_size_sections elf_i386_early_size_sections - #define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections - #define elf_backend_fake_sections elf_i386_fake_sections - #define elf_backend_finish_dynamic_sections elf_i386_finish_dynamic_sections ---- a/bfd/elf32-lm32.c -+++ b/bfd/elf32-lm32.c -@@ -1906,8 +1906,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --lm32_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+lm32_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - struct elf_lm32_link_hash_table *htab; - bfd *dynobj; -@@ -1920,7 +1920,8 @@ lm32_elf_size_dynamic_sections (bfd *out - return false; - - dynobj = htab->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->root.dynamic_sections_created) - { -@@ -2309,7 +2310,7 @@ lm32_elf_create_dynamic_sections (bfd *a - } - - static bool --lm32_elf_always_size_sections (bfd *output_bfd, struct bfd_link_info *info) -+lm32_elf_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - if (!bfd_link_relocatable (info)) - { -@@ -2395,7 +2396,7 @@ lm32_elf_fdpic_copy_private_bfd_data (bf - #define bfd_elf32_bfd_link_hash_table_create lm32_elf_link_hash_table_create - #define elf_backend_check_relocs lm32_elf_check_relocs - #define elf_backend_reloc_type_class lm32_elf_reloc_type_class --#define elf_backend_size_dynamic_sections lm32_elf_size_dynamic_sections -+#define elf_backend_late_size_sections lm32_elf_late_size_sections - #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all - #define elf_backend_create_dynamic_sections lm32_elf_create_dynamic_sections - #define elf_backend_finish_dynamic_sections lm32_elf_finish_dynamic_sections -@@ -2416,8 +2417,8 @@ lm32_elf_fdpic_copy_private_bfd_data (bf - #undef elf32_bed - #define elf32_bed elf32_lm32fdpic_bed - --#undef elf_backend_always_size_sections --#define elf_backend_always_size_sections lm32_elf_always_size_sections -+#undef elf_backend_early_size_sections -+#define elf_backend_early_size_sections lm32_elf_early_size_sections - #undef bfd_elf32_bfd_copy_private_bfd_data - #define bfd_elf32_bfd_copy_private_bfd_data lm32_elf_fdpic_copy_private_bfd_data - ---- a/bfd/elf32-m32c.c -+++ b/bfd/elf32-m32c.c -@@ -773,8 +773,8 @@ m32c_elf_finish_dynamic_sections (bfd *a - } - - static bool --m32c_elf_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+m32c_elf_early_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *splt; -@@ -2131,8 +2131,8 @@ _bfd_m32c_elf_eh_frame_address_size (bfd - #define elf_backend_check_relocs m32c_elf_check_relocs - #define elf_backend_object_p m32c_elf_object_p - #define elf_symbol_leading_char ('_') --#define elf_backend_always_size_sections \ -- m32c_elf_always_size_sections -+#define elf_backend_early_size_sections \ -+ m32c_elf_early_size_sections - #define elf_backend_finish_dynamic_sections \ - m32c_elf_finish_dynamic_sections - ---- a/bfd/elf32-m32r.c -+++ b/bfd/elf32-m32r.c -@@ -1958,8 +1958,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --m32r_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+m32r_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_link_hash_table *htab; - bfd *dynobj; -@@ -1968,7 +1968,7 @@ m32r_elf_size_dynamic_sections (bfd *out - bfd *ibfd; - - #ifdef DEBUG_PIC -- printf ("m32r_elf_size_dynamic_sections()\n"); -+ printf ("m32r_elf_late_size_sections()\n"); - #endif - - htab = m32r_elf_hash_table (info); -@@ -1976,7 +1976,8 @@ m32r_elf_size_dynamic_sections (bfd *out - return false; - - dynobj = htab->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->dynamic_sections_created) - { -@@ -3658,7 +3659,7 @@ m32r_elf_reloc_type_class (const struct - - #define elf_backend_create_dynamic_sections m32r_elf_create_dynamic_sections - #define bfd_elf32_bfd_link_hash_table_create m32r_elf_link_hash_table_create --#define elf_backend_size_dynamic_sections m32r_elf_size_dynamic_sections -+#define elf_backend_late_size_sections m32r_elf_late_size_sections - #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all - #define elf_backend_finish_dynamic_sections m32r_elf_finish_dynamic_sections - #define elf_backend_adjust_dynamic_symbol m32r_elf_adjust_dynamic_symbol ---- a/bfd/elf32-m68k.c -+++ b/bfd/elf32-m68k.c -@@ -2934,7 +2934,7 @@ elf_m68k_get_plt_info (bfd *output_bfd) - It's a convenient place to determine the PLT style. */ - - static bool --elf_m68k_always_size_sections (bfd *output_bfd, struct bfd_link_info *info) -+elf_m68k_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - /* Bind input BFDs to GOTs and calculate sizes of .got and .rela.got - sections. */ -@@ -3107,15 +3107,16 @@ elf_m68k_adjust_dynamic_symbol (struct b - /* Set the sizes of the dynamic sections. */ - - static bool --elf_m68k_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_m68k_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; - bool relocs; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -4628,12 +4629,11 @@ elf_m68k_grok_psinfo (bfd *abfd, Elf_Int - #define bfd_elf32_bfd_final_link bfd_elf_final_link - - #define elf_backend_check_relocs elf_m68k_check_relocs --#define elf_backend_always_size_sections \ -- elf_m68k_always_size_sections -+#define elf_backend_early_size_sections \ -+ elf_m68k_early_size_sections - #define elf_backend_adjust_dynamic_symbol \ - elf_m68k_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections \ -- elf_m68k_size_dynamic_sections -+#define elf_backend_late_size_sections elf_m68k_late_size_sections - #define elf_backend_final_write_processing elf_m68k_final_write_processing - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section elf_m68k_relocate_section ---- a/bfd/elf32-metag.c -+++ b/bfd/elf32-metag.c -@@ -2717,8 +2717,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --elf_metag_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_metag_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_metag_link_hash_table *htab; - bfd *dynobj; -@@ -2729,7 +2729,7 @@ elf_metag_size_dynamic_sections (bfd *ou - htab = metag_link_hash_table (info); - dynobj = htab->etab.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - if (htab->etab.dynamic_sections_created) - { -@@ -4019,7 +4019,7 @@ elf_metag_plt_sym_val (bfd_vma i, const - #define elf_backend_adjust_dynamic_symbol elf_metag_adjust_dynamic_symbol - #define elf_backend_finish_dynamic_symbol elf_metag_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections elf_metag_finish_dynamic_sections --#define elf_backend_size_dynamic_sections elf_metag_size_dynamic_sections -+#define elf_backend_late_size_sections elf_metag_late_size_sections - #define elf_backend_omit_section_dynsym \ - _bfd_elf_omit_section_dynsym_all - #define elf_backend_init_file_header elf_metag_init_file_header ---- a/bfd/elf32-microblaze.c -+++ b/bfd/elf32-microblaze.c -@@ -2946,8 +2946,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --microblaze_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+microblaze_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf32_mb_link_hash_table *htab; - bfd *dynobj; -@@ -2959,7 +2959,8 @@ microblaze_elf_size_dynamic_sections (bf - return false; - - dynobj = htab->elf.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - /* Set up .got offsets for local syms, and space for local dynamic - relocs. */ -@@ -3477,7 +3478,7 @@ microblaze_elf_add_symbol_hook (bfd *abf - #define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections - #define elf_backend_finish_dynamic_sections microblaze_elf_finish_dynamic_sections - #define elf_backend_finish_dynamic_symbol microblaze_elf_finish_dynamic_symbol --#define elf_backend_size_dynamic_sections microblaze_elf_size_dynamic_sections -+#define elf_backend_late_size_sections microblaze_elf_late_size_sections - #define elf_backend_add_symbol_hook microblaze_elf_add_symbol_hook - - #include "elf32-target.h" ---- a/bfd/elf32-mips.c -+++ b/bfd/elf32-mips.c -@@ -2534,10 +2534,8 @@ static const struct ecoff_debug_swap mip - #define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mips_elf_adjust_dynamic_symbol --#define elf_backend_always_size_sections \ -- _bfd_mips_elf_always_size_sections --#define elf_backend_size_dynamic_sections \ -- _bfd_mips_elf_size_dynamic_sections -+#define elf_backend_early_size_sections _bfd_mips_elf_early_size_sections -+#define elf_backend_late_size_sections _bfd_mips_elf_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section _bfd_mips_elf_relocate_section - #define elf_backend_finish_dynamic_symbol \ ---- a/bfd/elf32-nds32.c -+++ b/bfd/elf32-nds32.c -@@ -4302,8 +4302,8 @@ elf32_nds32_add_dynreloc (bfd *output_bf - /* Set the sizes of the dynamic sections. */ - - static bool --nds32_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+nds32_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_nds32_link_hash_table *htab; - bfd *dynobj; -@@ -4316,7 +4316,8 @@ nds32_elf_size_dynamic_sections (bfd *ou - return false; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -13984,7 +13985,7 @@ nds32_elf_unify_tls_model (bfd *inbfd, a - #define elf_backend_create_dynamic_sections nds32_elf_create_dynamic_sections - #define elf_backend_finish_dynamic_sections nds32_elf_finish_dynamic_sections - #define elf_backend_finish_dynamic_symbol nds32_elf_finish_dynamic_symbol --#define elf_backend_size_dynamic_sections nds32_elf_size_dynamic_sections -+#define elf_backend_late_size_sections nds32_elf_late_size_sections - #define elf_backend_relocate_section nds32_elf_relocate_section - #define elf_backend_gc_mark_hook nds32_elf_gc_mark_hook - #define elf_backend_grok_prstatus nds32_elf_grok_prstatus ---- a/bfd/elf32-nios2.c -+++ b/bfd/elf32-nios2.c -@@ -5411,7 +5411,7 @@ nios2_elf32_adjust_dynamic_symbol (struc - return true; - } - --/* Worker function for nios2_elf32_size_dynamic_sections. */ -+/* Worker function for nios2_elf32_late_size_sections. */ - static bool - adjust_dynrelocs (struct elf_link_hash_entry *h, void *inf) - { -@@ -5438,7 +5438,7 @@ adjust_dynrelocs (struct elf_link_hash_e - return true; - } - --/* Another worker function for nios2_elf32_size_dynamic_sections. -+/* Another worker function for nios2_elf32_late_size_sections. - Allocate space in .plt, .got and associated reloc sections for - dynamic relocs. */ - static bool -@@ -5673,11 +5673,11 @@ allocate_dynrelocs (struct elf_link_hash - return true; - } - --/* Implement elf_backend_size_dynamic_sections: -+/* Implement elf_backend_late_size_sections: - Set the sizes of the dynamic sections. */ - static bool --nios2_elf32_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+nios2_elf32_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; -@@ -5687,7 +5687,8 @@ nios2_elf32_size_dynamic_sections (bfd * - - htab = elf32_nios2_hash_table (info); - dynobj = htab->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - htab->res_n_size = 0; - if (htab->root.dynamic_sections_created) -@@ -6058,7 +6059,7 @@ const struct bfd_elf_special_section elf - nios2_elf32_finish_dynamic_sections - #define elf_backend_adjust_dynamic_symbol nios2_elf32_adjust_dynamic_symbol - #define elf_backend_reloc_type_class nios2_elf32_reloc_type_class --#define elf_backend_size_dynamic_sections nios2_elf32_size_dynamic_sections -+#define elf_backend_late_size_sections nios2_elf32_late_size_sections - #define elf_backend_add_symbol_hook nios2_elf_add_symbol_hook - #define elf_backend_copy_indirect_symbol nios2_elf32_copy_indirect_symbol - #define elf_backend_object_p nios2_elf32_object_p ---- a/bfd/elf32-or1k.c -+++ b/bfd/elf32-or1k.c -@@ -3039,8 +3039,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --or1k_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+or1k_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_or1k_link_hash_table *htab; - bfd *dynobj; -@@ -3053,7 +3053,8 @@ or1k_elf_size_dynamic_sections (bfd *out - return false; - - dynobj = htab->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->root.dynamic_sections_created) - { -@@ -3406,7 +3407,7 @@ or1k_grok_psinfo (bfd *abfd, Elf_Interna - #define elf_backend_copy_indirect_symbol or1k_elf_copy_indirect_symbol - #define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections - #define elf_backend_finish_dynamic_sections or1k_elf_finish_dynamic_sections --#define elf_backend_size_dynamic_sections or1k_elf_size_dynamic_sections -+#define elf_backend_late_size_sections or1k_elf_late_size_sections - #define elf_backend_adjust_dynamic_symbol or1k_elf_adjust_dynamic_symbol - #define elf_backend_finish_dynamic_symbol or1k_elf_finish_dynamic_symbol - ---- a/bfd/elf32-ppc.c -+++ b/bfd/elf32-ppc.c -@@ -5478,8 +5478,8 @@ static const unsigned char glink_eh_fram - /* Set the sizes of the dynamic sections. */ - - static bool --ppc_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+ppc_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - struct ppc_elf_link_hash_table *htab; - asection *s; -@@ -5487,11 +5487,12 @@ ppc_elf_size_dynamic_sections (bfd *outp - bfd *ibfd; - - #ifdef DEBUG -- fprintf (stderr, "ppc_elf_size_dynamic_sections called\n"); -+ fprintf (stderr, "ppc_elf_late_size_sections called\n"); - #endif - - htab = ppc_elf_hash_table (info); -- BFD_ASSERT (htab->elf.dynobj != NULL); -+ if (htab->elf.dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -10414,7 +10415,7 @@ ppc_elf_finish_dynamic_sections (bfd *ou - #define elf_backend_copy_indirect_symbol ppc_elf_copy_indirect_symbol - #define elf_backend_adjust_dynamic_symbol ppc_elf_adjust_dynamic_symbol - #define elf_backend_add_symbol_hook ppc_elf_add_symbol_hook --#define elf_backend_size_dynamic_sections ppc_elf_size_dynamic_sections -+#define elf_backend_late_size_sections ppc_elf_late_size_sections - #define elf_backend_hash_symbol ppc_elf_hash_symbol - #define elf_backend_finish_dynamic_symbol ppc_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections ppc_elf_finish_dynamic_sections ---- a/bfd/elf32-rl78.c -+++ b/bfd/elf32-rl78.c -@@ -1440,8 +1440,8 @@ rl78_elf_finish_dynamic_sections (bfd *a - } - - static bool --rl78_elf_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+rl78_elf_early_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *splt; -@@ -2609,8 +2609,8 @@ rl78_elf_relax_section (bfd *abfd, - - #define bfd_elf32_bfd_relax_section rl78_elf_relax_section - #define elf_backend_check_relocs rl78_elf_check_relocs --#define elf_backend_always_size_sections \ -- rl78_elf_always_size_sections -+#define elf_backend_early_size_sections \ -+ rl78_elf_early_size_sections - #define elf_backend_finish_dynamic_sections \ - rl78_elf_finish_dynamic_sections - ---- a/bfd/elf32-s390.c -+++ b/bfd/elf32-s390.c -@@ -1366,7 +1366,7 @@ elf_s390_gc_mark_hook (asection *sec, - entry but we found we will not create any. Called when we find we will - not have any PLT for this symbol, by for example - elf_s390_adjust_dynamic_symbol when we're doing a proper dynamic link, -- or elf_s390_size_dynamic_sections if no dynamic sections will be -+ or elf_s390_late_size_sections if no dynamic sections will be - created (we're only linking static objects). */ - - static void -@@ -1778,8 +1778,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --elf_s390_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_s390_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_s390_link_hash_table *htab; - bfd *dynobj; -@@ -1790,7 +1790,7 @@ elf_s390_size_dynamic_sections (bfd *out - htab = elf_s390_hash_table (info); - dynobj = htab->elf.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - if (htab->elf.dynamic_sections_created) - { -@@ -3926,7 +3926,7 @@ elf32_s390_merge_private_bfd_data (bfd * - #define elf_backend_gc_mark_hook elf_s390_gc_mark_hook - #define elf_backend_reloc_type_class elf_s390_reloc_type_class - #define elf_backend_relocate_section elf_s390_relocate_section --#define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections -+#define elf_backend_late_size_sections elf_s390_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_grok_prstatus elf_s390_grok_prstatus - #define elf_backend_grok_psinfo elf_s390_grok_psinfo ---- a/bfd/elf32-score.c -+++ b/bfd/elf32-score.c -@@ -1089,7 +1089,7 @@ score_elf_got_info (bfd *abfd, asection - appear towards the end. This reduces the amount of GOT space - required. MAX_LOCAL is used to set the number of local symbols - known to be in the dynamic symbol table. During -- s3_bfd_score_elf_size_dynamic_sections, this value is 1. Afterward, the -+ s3_bfd_score_elf_late_size_sections, this value is 1. Afterward, the - section symbols are added and the count is higher. */ - static bool - score_elf_sort_hash_table (struct bfd_link_info *info, -@@ -3160,8 +3160,8 @@ s3_bfd_score_elf_adjust_dynamic_symbol ( - /* This function is called after all the input files have been read, - and the input sections have been assigned to output sections. */ - static bool --s3_bfd_score_elf_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+s3_bfd_score_elf_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; -@@ -3237,14 +3237,15 @@ s3_bfd_score_elf_always_size_sections (b - - /* Set the sizes of the dynamic sections. */ - static bool --s3_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+s3_bfd_score_elf_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; - bool reltext; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -3313,7 +3314,7 @@ s3_bfd_score_elf_size_dynamic_sections ( - } - else if (startswith (name, ".got")) - { -- /* s3_bfd_score_elf_always_size_sections() has already done -+ /* s3_bfd_score_elf_early_size_sections() has already done - most of the work, but some symbols may have been mapped - to versions that we must now resolve in the got_entries - hash tables. */ -@@ -4177,22 +4178,22 @@ _bfd_score_elf_adjust_dynamic_symbol (st - } - - static bool --_bfd_score_elf_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+_bfd_score_elf_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - if (bfd_get_mach (output_bfd) == bfd_mach_score3) -- return s3_bfd_score_elf_always_size_sections (output_bfd, info); -+ return s3_bfd_score_elf_early_size_sections (output_bfd, info); - else -- return s7_bfd_score_elf_always_size_sections (output_bfd, info); -+ return s7_bfd_score_elf_early_size_sections (output_bfd, info); - } - - static bool --_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+_bfd_score_elf_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - if (bfd_get_mach (output_bfd) == bfd_mach_score3) -- return s3_bfd_score_elf_size_dynamic_sections (output_bfd, info); -+ return s3_bfd_score_elf_late_size_sections (output_bfd, info); - else -- return s7_bfd_score_elf_size_dynamic_sections (output_bfd, info); -+ return s7_bfd_score_elf_late_size_sections (output_bfd, info); - } - - static bool -@@ -4455,10 +4456,10 @@ _bfd_score_elf_common_definition (Elf_In - _bfd_score_elf_section_from_bfd_section - #define elf_backend_adjust_dynamic_symbol \ - _bfd_score_elf_adjust_dynamic_symbol --#define elf_backend_always_size_sections \ -- _bfd_score_elf_always_size_sections --#define elf_backend_size_dynamic_sections \ -- _bfd_score_elf_size_dynamic_sections -+#define elf_backend_early_size_sections \ -+ _bfd_score_elf_early_size_sections -+#define elf_backend_late_size_sections \ -+ _bfd_score_elf_late_size_sections - #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all - #define elf_backend_create_dynamic_sections \ - _bfd_score_elf_create_dynamic_sections ---- a/bfd/elf32-score.h -+++ b/bfd/elf32-score.h -@@ -78,10 +78,10 @@ s7_bfd_score_elf_adjust_dynamic_symbol ( - struct elf_link_hash_entry *); - - extern bool --s7_bfd_score_elf_always_size_sections (bfd *, struct bfd_link_info *); -+s7_bfd_score_elf_early_size_sections (bfd *, struct bfd_link_info *); - - extern bool --s7_bfd_score_elf_size_dynamic_sections (bfd *, struct bfd_link_info *); -+s7_bfd_score_elf_late_size_sections (bfd *, struct bfd_link_info *); - - extern bool - s7_bfd_score_elf_create_dynamic_sections (bfd *, struct bfd_link_info *); ---- a/bfd/elf32-score7.c -+++ b/bfd/elf32-score7.c -@@ -975,7 +975,7 @@ score_elf_got_info (bfd *abfd, asection - appear towards the end. This reduces the amount of GOT space - required. MAX_LOCAL is used to set the number of local symbols - known to be in the dynamic symbol table. During -- s7_bfd_score_elf_size_dynamic_sections, this value is 1. Afterward, the -+ s7_bfd_score_elf_late_size_sections, this value is 1. Afterward, the - section symbols are added and the count is higher. */ - - static bool -@@ -2969,8 +2969,8 @@ s7_bfd_score_elf_adjust_dynamic_symbol ( - and the input sections have been assigned to output sections. */ - - bool --s7_bfd_score_elf_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+s7_bfd_score_elf_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; -@@ -3047,14 +3047,15 @@ s7_bfd_score_elf_always_size_sections (b - /* Set the sizes of the dynamic sections. */ - - bool --s7_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+s7_bfd_score_elf_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; - bool reltext; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -3123,7 +3124,7 @@ s7_bfd_score_elf_size_dynamic_sections ( - } - else if (startswith (name, ".got")) - { -- /* s7_bfd_score_elf_always_size_sections() has already done -+ /* s7_bfd_score_elf_early_size_sections() has already done - most of the work, but some symbols may have been mapped - to versions that we must now resolve in the got_entries - hash tables. */ ---- a/bfd/elf32-sh.c -+++ b/bfd/elf32-sh.c -@@ -2925,7 +2925,7 @@ allocate_dynrelocs (struct elf_link_hash - It's a convenient place to determine the PLT style. */ - - static bool --sh_elf_always_size_sections (bfd *output_bfd, struct bfd_link_info *info) -+sh_elf_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - sh_elf_hash_table (info)->plt_info = get_plt_info (output_bfd, - bfd_link_pic (info)); -@@ -2940,8 +2940,8 @@ sh_elf_always_size_sections (bfd *output - /* Set the sizes of the dynamic sections. */ - - static bool --sh_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+sh_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_sh_link_hash_table *htab; - bfd *dynobj; -@@ -2954,7 +2954,8 @@ sh_elf_size_dynamic_sections (bfd *outpu - return false; - - dynobj = htab->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->root.dynamic_sections_created) - { -@@ -6598,10 +6599,8 @@ sh_elf_encode_eh_address (bfd *abfd, - sh_elf_link_hash_table_create - #define elf_backend_adjust_dynamic_symbol \ - sh_elf_adjust_dynamic_symbol --#define elf_backend_always_size_sections \ -- sh_elf_always_size_sections --#define elf_backend_size_dynamic_sections \ -- sh_elf_size_dynamic_sections -+#define elf_backend_early_size_sections sh_elf_early_size_sections -+#define elf_backend_late_size_sections sh_elf_late_size_sections - #define elf_backend_omit_section_dynsym sh_elf_omit_section_dynsym - #define elf_backend_finish_dynamic_symbol \ - sh_elf_finish_dynamic_symbol ---- a/bfd/elf32-sparc.c -+++ b/bfd/elf32-sparc.c -@@ -248,8 +248,7 @@ elf32_sparc_reloc_type_class (const stru - #define elf_backend_adjust_dynamic_symbol \ - _bfd_sparc_elf_adjust_dynamic_symbol - #define elf_backend_omit_section_dynsym _bfd_sparc_elf_omit_section_dynsym --#define elf_backend_size_dynamic_sections \ -- _bfd_sparc_elf_size_dynamic_sections -+#define elf_backend_late_size_sections _bfd_sparc_elf_late_size_sections - #define elf_backend_relocate_section _bfd_sparc_elf_relocate_section - #define elf_backend_finish_dynamic_symbol \ - _bfd_sparc_elf_finish_dynamic_symbol ---- a/bfd/elf32-tic6x.c -+++ b/bfd/elf32-tic6x.c -@@ -3160,7 +3160,7 @@ elf32_tic6x_allocate_dynrelocs (struct e - /* Set the sizes of the dynamic sections. */ - - static bool --elf32_tic6x_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+elf32_tic6x_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - struct elf32_tic6x_link_hash_table *htab; - bfd *dynobj; -@@ -3171,7 +3171,7 @@ elf32_tic6x_size_dynamic_sections (bfd * - htab = elf32_tic6x_hash_table (info); - dynobj = htab->elf.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - if (htab->elf.dynamic_sections_created) - { -@@ -3358,7 +3358,7 @@ elf32_tic6x_size_dynamic_sections (bfd * - and the input sections have been assigned to output sections. */ - - static bool --elf32_tic6x_always_size_sections (bfd *output_bfd, struct bfd_link_info *info) -+elf32_tic6x_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - if (elf32_tic6x_using_dsbt (output_bfd) && !bfd_link_relocatable (info) - && !bfd_elf_stack_segment_size (output_bfd, info, -@@ -4261,10 +4261,10 @@ elf32_tic6x_write_section (bfd *output_b - #define elf_backend_relocs_compatible _bfd_elf_relocs_compatible - #define elf_backend_finish_dynamic_symbol \ - elf32_tic6x_finish_dynamic_symbol --#define elf_backend_always_size_sections \ -- elf32_tic6x_always_size_sections --#define elf_backend_size_dynamic_sections \ -- elf32_tic6x_size_dynamic_sections -+#define elf_backend_early_size_sections \ -+ elf32_tic6x_early_size_sections -+#define elf_backend_late_size_sections \ -+ elf32_tic6x_late_size_sections - #define elf_backend_finish_dynamic_sections \ - elf32_tic6x_finish_dynamic_sections - #define bfd_elf32_bfd_final_link \ ---- a/bfd/elf32-tilegx.c -+++ b/bfd/elf32-tilegx.c -@@ -105,7 +105,7 @@ tilegx_elf_grok_psinfo (bfd *abfd, Elf_I - #define elf_backend_check_relocs tilegx_elf_check_relocs - #define elf_backend_adjust_dynamic_symbol tilegx_elf_adjust_dynamic_symbol - #define elf_backend_omit_section_dynsym tilegx_elf_omit_section_dynsym --#define elf_backend_size_dynamic_sections tilegx_elf_size_dynamic_sections -+#define elf_backend_late_size_sections tilegx_elf_late_size_sections - #define elf_backend_relocate_section tilegx_elf_relocate_section - #define elf_backend_finish_dynamic_symbol tilegx_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections tilegx_elf_finish_dynamic_sections ---- a/bfd/elf32-tilepro.c -+++ b/bfd/elf32-tilepro.c -@@ -2182,11 +2182,9 @@ tilepro_elf_omit_section_dynsym (bfd *ou - #define ELF32_DYNAMIC_INTERPRETER "/lib/ld.so.1" - - static bool --tilepro_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+tilepro_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { -- (void)output_bfd; -- - struct elf_link_hash_table *htab; - bfd *dynobj; - asection *s; -@@ -2195,7 +2193,8 @@ tilepro_elf_size_dynamic_sections (bfd * - htab = tilepro_elf_hash_table (info); - BFD_ASSERT (htab != NULL); - dynobj = htab->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -3739,7 +3738,7 @@ tilepro_additional_program_headers (bfd - #define elf_backend_check_relocs tilepro_elf_check_relocs - #define elf_backend_adjust_dynamic_symbol tilepro_elf_adjust_dynamic_symbol - #define elf_backend_omit_section_dynsym tilepro_elf_omit_section_dynsym --#define elf_backend_size_dynamic_sections tilepro_elf_size_dynamic_sections -+#define elf_backend_late_size_sections tilepro_elf_late_size_sections - #define elf_backend_relocate_section tilepro_elf_relocate_section - #define elf_backend_finish_dynamic_symbol tilepro_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections tilepro_elf_finish_dynamic_sections ---- a/bfd/elf32-vax.c -+++ b/bfd/elf32-vax.c -@@ -36,7 +36,6 @@ static bool elf_vax_check_relocs (bfd *, - asection *, const Elf_Internal_Rela *); - static bool elf_vax_adjust_dynamic_symbol (struct bfd_link_info *, - struct elf_link_hash_entry *); --static bool elf_vax_size_dynamic_sections (bfd *, struct bfd_link_info *); - static int elf_vax_relocate_section (bfd *, struct bfd_link_info *, - bfd *, asection *, bfd_byte *, - Elf_Internal_Rela *, -@@ -985,8 +984,8 @@ elf_vax_discard_got_entries (struct elf_ - /* Discard unused dynamic data if this is a static link. */ - - static bool --elf_vax_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_vax_early_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; -@@ -1024,14 +1023,15 @@ elf_vax_always_size_sections (bfd *outpu - /* Set the sizes of the dynamic sections. */ - - static bool --elf_vax_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+elf_vax_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; - bool relocs; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -1861,10 +1861,8 @@ elf_vax_plt_sym_val (bfd_vma i, const as - #define elf_backend_check_relocs elf_vax_check_relocs - #define elf_backend_adjust_dynamic_symbol \ - elf_vax_adjust_dynamic_symbol --#define elf_backend_always_size_sections \ -- elf_vax_always_size_sections --#define elf_backend_size_dynamic_sections \ -- elf_vax_size_dynamic_sections -+#define elf_backend_early_size_sections elf_vax_early_size_sections -+#define elf_backend_late_size_sections elf_vax_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section elf_vax_relocate_section - #define elf_backend_finish_dynamic_symbol \ ---- a/bfd/elf32-xstormy16.c -+++ b/bfd/elf32-xstormy16.c -@@ -706,8 +706,8 @@ xstormy16_elf_relax_section (bfd *dynobj - } - - static bool --xstormy16_elf_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+xstormy16_elf_early_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *splt; -@@ -1013,8 +1013,8 @@ xstormy16_elf_gc_mark_hook (asection *se - #define elf_backend_relocate_section xstormy16_elf_relocate_section - #define elf_backend_gc_mark_hook xstormy16_elf_gc_mark_hook - #define elf_backend_check_relocs xstormy16_elf_check_relocs --#define elf_backend_always_size_sections \ -- xstormy16_elf_always_size_sections -+#define elf_backend_early_size_sections \ -+ xstormy16_elf_early_size_sections - #define elf_backend_omit_section_dynsym \ - _bfd_elf_omit_section_dynsym_all - #define elf_backend_finish_dynamic_sections \ ---- a/bfd/elf32-xtensa.c -+++ b/bfd/elf32-xtensa.c -@@ -1557,8 +1557,8 @@ elf_xtensa_allocate_local_got_size (stru - /* Set the sizes of the dynamic sections. */ - - static bool --elf_xtensa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_xtensa_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_xtensa_link_hash_table *htab; - bfd *dynobj, *abfd; -@@ -1575,7 +1575,7 @@ elf_xtensa_size_dynamic_sections (bfd *o - - dynobj = elf_hash_table (info)->dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - srelgot = htab->elf.srelgot; - srelplt = htab->elf.srelplt; - -@@ -1780,8 +1780,7 @@ elf_xtensa_size_dynamic_sections (bfd *o - } - - static bool --elf_xtensa_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf_xtensa_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - struct elf_xtensa_link_hash_table *htab; - asection *tls_sec; -@@ -11537,8 +11536,8 @@ static const struct bfd_elf_special_sect - #define elf_backend_object_p elf_xtensa_object_p - #define elf_backend_reloc_type_class elf_xtensa_reloc_type_class - #define elf_backend_relocate_section elf_xtensa_relocate_section --#define elf_backend_size_dynamic_sections elf_xtensa_size_dynamic_sections --#define elf_backend_always_size_sections elf_xtensa_always_size_sections -+#define elf_backend_late_size_sections elf_xtensa_late_size_sections -+#define elf_backend_early_size_sections elf_xtensa_early_size_sections - #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all - #define elf_backend_special_sections elf_xtensa_special_sections - #define elf_backend_action_discarded elf_xtensa_action_discarded ---- a/bfd/elf64-alpha.c -+++ b/bfd/elf64-alpha.c -@@ -2579,8 +2579,8 @@ elf64_alpha_size_plt_section (struct bfd - } - - static bool --elf64_alpha_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf64_alpha_early_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *i; - struct alpha_elf_link_hash_table * htab; -@@ -2806,8 +2806,8 @@ elf64_alpha_size_rela_got_section (struc - /* Set the sizes of the dynamic sections. */ - - static bool --elf64_alpha_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf64_alpha_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; -@@ -2819,7 +2819,8 @@ elf64_alpha_size_dynamic_sections (bfd * - return false; - - dynobj = elf_hash_table(info)->dynobj; -- BFD_ASSERT(dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -5465,10 +5466,10 @@ static const struct elf_size_info alpha_ - elf64_alpha_merge_symbol_attribute - #define elf_backend_copy_indirect_symbol \ - elf64_alpha_copy_indirect_symbol --#define elf_backend_always_size_sections \ -- elf64_alpha_always_size_sections --#define elf_backend_size_dynamic_sections \ -- elf64_alpha_size_dynamic_sections -+#define elf_backend_early_size_sections \ -+ elf64_alpha_early_size_sections -+#define elf_backend_late_size_sections \ -+ elf64_alpha_late_size_sections - #define elf_backend_omit_section_dynsym \ - _bfd_elf_omit_section_dynsym_all - #define elf_backend_relocate_section \ ---- a/bfd/elf64-hppa.c -+++ b/bfd/elf64-hppa.c -@@ -176,9 +176,6 @@ static bool elf64_hppa_adjust_dynamic_sy - static bool elf64_hppa_mark_milli_and_exported_functions - (struct elf_link_hash_entry *, void *); - --static bool elf64_hppa_size_dynamic_sections -- (bfd *, struct bfd_link_info *); -- - static int elf64_hppa_link_output_symbol_hook - (struct bfd_link_info *, const char *, Elf_Internal_Sym *, - asection *, struct elf_link_hash_entry *); -@@ -1520,7 +1517,7 @@ elf64_hppa_mark_milli_and_exported_funct - the contents of our special sections. */ - - static bool --elf64_hppa_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+elf64_hppa_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - struct elf64_hppa_link_hash_table *hppa_info; - struct elf64_hppa_allocate_data data; -@@ -1534,7 +1531,8 @@ elf64_hppa_size_dynamic_sections (bfd *o - return false; - - dynobj = hppa_info->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - /* Mark each function this program exports so that we will allocate - space in the .opd section for each function's FPTR. If we are -@@ -3984,8 +3982,7 @@ const struct elf_size_info hppa64_elf_si - #define elf_backend_adjust_dynamic_symbol \ - elf64_hppa_adjust_dynamic_symbol - --#define elf_backend_size_dynamic_sections \ -- elf64_hppa_size_dynamic_sections -+#define elf_backend_late_size_sections elf64_hppa_late_size_sections - - #define elf_backend_finish_dynamic_symbol \ - elf64_hppa_finish_dynamic_symbol ---- a/bfd/elf64-ia64-vms.c -+++ b/bfd/elf64-ia64-vms.c -@@ -2590,8 +2590,8 @@ elf64_ia64_adjust_dynamic_symbol (struct - } - - static bool --elf64_ia64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf64_ia64_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf64_ia64_allocate_data data; - struct elf64_ia64_link_hash_table *ia64_info; -@@ -2600,11 +2600,12 @@ elf64_ia64_size_dynamic_sections (bfd *o - struct elf_link_hash_table *hash_table; - - hash_table = elf_hash_table (info); -- dynobj = hash_table->dynobj; - ia64_info = elf64_ia64_hash_table (info); - if (ia64_info == NULL) - return false; -- BFD_ASSERT(dynobj != NULL); -+ dynobj = hash_table->dynobj; -+ if (dynobj == NULL) -+ return true; - data.info = info; - - /* Allocate the GOT entries. */ -@@ -5484,8 +5485,8 @@ static const struct elf_size_info elf64_ - elf64_ia64_check_relocs - #define elf_backend_adjust_dynamic_symbol \ - elf64_ia64_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections \ -- elf64_ia64_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ elf64_ia64_late_size_sections - #define elf_backend_omit_section_dynsym \ - _bfd_elf_omit_section_dynsym_all - #define elf_backend_relocate_section \ ---- a/bfd/elf64-mips.c -+++ b/bfd/elf64-mips.c -@@ -4745,10 +4745,10 @@ const struct elf_size_info mips_elf64_si - #define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mips_elf_adjust_dynamic_symbol --#define elf_backend_always_size_sections \ -- _bfd_mips_elf_always_size_sections --#define elf_backend_size_dynamic_sections \ -- _bfd_mips_elf_size_dynamic_sections -+#define elf_backend_early_size_sections \ -+ _bfd_mips_elf_early_size_sections -+#define elf_backend_late_size_sections \ -+ _bfd_mips_elf_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section _bfd_mips_elf_relocate_section - #define elf_backend_finish_dynamic_symbol \ ---- a/bfd/elf64-ppc.c -+++ b/bfd/elf64-ppc.c -@@ -118,8 +118,8 @@ static bfd_vma opd_entry_value - #define elf_backend_adjust_dynamic_symbol ppc64_elf_adjust_dynamic_symbol - #define elf_backend_hide_symbol ppc64_elf_hide_symbol - #define elf_backend_maybe_function_sym ppc64_elf_maybe_function_sym --#define elf_backend_always_size_sections ppc64_elf_edit --#define elf_backend_size_dynamic_sections ppc64_elf_size_dynamic_sections -+#define elf_backend_early_size_sections ppc64_elf_edit -+#define elf_backend_late_size_sections ppc64_elf_late_size_sections - #define elf_backend_hash_symbol ppc64_elf_hash_symbol - #define elf_backend_init_index_section _bfd_elf_init_2_index_sections - #define elf_backend_action_discarded ppc64_elf_action_discarded -@@ -10118,7 +10118,7 @@ allocate_dynrelocs (struct elf_link_hash - ((((v) & 0x3ffff0000ULL) << 16) | (v & 0xffff)) - #define HA34(v) ((v + (1ULL << 33)) >> 34) - --/* Called via elf_link_hash_traverse from ppc64_elf_size_dynamic_sections -+/* Called via elf_link_hash_traverse from ppc64_elf_late_size_sections - to set up space for global entry stubs. These are put in glink, - after the branch table. */ - -@@ -10195,8 +10195,8 @@ size_global_entry_stubs (struct elf_link - /* Set the sizes of the dynamic sections. */ - - static bool --ppc64_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+ppc64_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - struct ppc_link_hash_table *htab; - bfd *dynobj; -@@ -10211,7 +10211,7 @@ ppc64_elf_size_dynamic_sections (bfd *ou - - dynobj = htab->elf.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - if (htab->elf.dynamic_sections_created) - { ---- a/bfd/elf64-s390.c -+++ b/bfd/elf64-s390.c -@@ -1301,7 +1301,7 @@ elf_s390_gc_mark_hook (asection *sec, - entry but we found we will not create any. Called when we find we will - not have any PLT for this symbol, by for example - elf_s390_adjust_dynamic_symbol when we're doing a proper dynamic link, -- or elf_s390_size_dynamic_sections if no dynamic sections will be -+ or elf_s390_late_size_sections if no dynamic sections will be - created (we're only linking static objects). */ - - static void -@@ -1714,8 +1714,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --elf_s390_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_s390_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_s390_link_hash_table *htab; - bfd *dynobj; -@@ -1729,7 +1729,7 @@ elf_s390_size_dynamic_sections (bfd *out - - dynobj = htab->elf.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - if (htab->elf.dynamic_sections_created) - { -@@ -3912,7 +3912,7 @@ const struct elf_size_info s390_elf64_si - #define elf_backend_gc_mark_hook elf_s390_gc_mark_hook - #define elf_backend_reloc_type_class elf_s390_reloc_type_class - #define elf_backend_relocate_section elf_s390_relocate_section --#define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections -+#define elf_backend_late_size_sections elf_s390_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_grok_prstatus elf_s390_grok_prstatus - #define elf_backend_grok_psinfo elf_s390_grok_psinfo ---- a/bfd/elf64-sparc.c -+++ b/bfd/elf64-sparc.c -@@ -953,8 +953,8 @@ const struct elf_size_info elf64_sparc_s - _bfd_sparc_elf_adjust_dynamic_symbol - #define elf_backend_omit_section_dynsym \ - _bfd_sparc_elf_omit_section_dynsym --#define elf_backend_size_dynamic_sections \ -- _bfd_sparc_elf_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ _bfd_sparc_elf_late_size_sections - #define elf_backend_relocate_section \ - _bfd_sparc_elf_relocate_section - #define elf_backend_finish_dynamic_symbol \ ---- a/bfd/elf64-tilegx.c -+++ b/bfd/elf64-tilegx.c -@@ -106,7 +106,7 @@ tilegx_elf_grok_psinfo (bfd *abfd, Elf_I - #define elf_backend_check_relocs tilegx_elf_check_relocs - #define elf_backend_adjust_dynamic_symbol tilegx_elf_adjust_dynamic_symbol - #define elf_backend_omit_section_dynsym tilegx_elf_omit_section_dynsym --#define elf_backend_size_dynamic_sections tilegx_elf_size_dynamic_sections -+#define elf_backend_late_size_sections tilegx_elf_late_size_sections - #define elf_backend_relocate_section tilegx_elf_relocate_section - #define elf_backend_finish_dynamic_symbol tilegx_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections tilegx_elf_finish_dynamic_sections ---- a/bfd/elf64-x86-64.c -+++ b/bfd/elf64-x86-64.c -@@ -2456,8 +2456,7 @@ elf_x86_64_scan_relocs (bfd *abfd, struc - } - - static bool --elf_x86_64_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf_x86_64_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - bfd *abfd; - -@@ -2470,7 +2469,7 @@ elf_x86_64_always_size_sections (bfd *ou - elf_x86_64_scan_relocs)) - return false; - -- return _bfd_x86_elf_always_size_sections (output_bfd, info); -+ return _bfd_x86_elf_early_size_sections (output_bfd, info); - } - - /* Return the relocation value for @tpoff relocation -@@ -5384,7 +5383,7 @@ elf_x86_64_special_sections[]= - elf_x86_64_reloc_name_lookup - - #define elf_backend_relocs_compatible elf_x86_64_relocs_compatible --#define elf_backend_always_size_sections elf_x86_64_always_size_sections -+#define elf_backend_early_size_sections elf_x86_64_early_size_sections - #define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections - #define elf_backend_finish_dynamic_sections elf_x86_64_finish_dynamic_sections - #define elf_backend_finish_dynamic_symbol elf_x86_64_finish_dynamic_symbol ---- a/bfd/elflink.c -+++ b/bfd/elflink.c -@@ -6619,8 +6619,8 @@ bfd_elf_size_dynamic_sections (bfd *outp - - /* The backend may have to create some sections regardless of whether - we're dynamic or not. */ -- if (bed->elf_backend_always_size_sections -- && ! (*bed->elf_backend_always_size_sections) (output_bfd, info)) -+ if (bed->elf_backend_early_size_sections -+ && !bed->elf_backend_early_size_sections (output_bfd, info)) - return false; - - dynobj = elf_hash_table (info)->dynobj; -@@ -7400,9 +7400,8 @@ NOTE: This behaviour is deprecated and w - - /* The backend must work out the sizes of all the other dynamic - sections. */ -- if (dynobj != NULL -- && bed->elf_backend_size_dynamic_sections != NULL -- && ! (*bed->elf_backend_size_dynamic_sections) (output_bfd, info)) -+ if (bed->elf_backend_late_size_sections != NULL -+ && !bed->elf_backend_late_size_sections (output_bfd, info)) - return false; - - if (dynobj != NULL && elf_hash_table (info)->dynamic_sections_created) ---- a/bfd/elfn32-mips.c -+++ b/bfd/elfn32-mips.c -@@ -4131,10 +4131,8 @@ static const struct ecoff_debug_swap mip - #define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mips_elf_adjust_dynamic_symbol --#define elf_backend_always_size_sections \ -- _bfd_mips_elf_always_size_sections --#define elf_backend_size_dynamic_sections \ -- _bfd_mips_elf_size_dynamic_sections -+#define elf_backend_early_size_sections _bfd_mips_elf_early_size_sections -+#define elf_backend_late_size_sections _bfd_mips_elf_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section _bfd_mips_elf_relocate_section - #define elf_backend_finish_dynamic_symbol \ ---- a/bfd/elfnn-aarch64.c -+++ b/bfd/elfnn-aarch64.c -@@ -112,7 +112,7 @@ - allocate space for one relocation on the slot. Record the GOT offset - for this symbol. - -- elfNN_aarch64_size_dynamic_sections () -+ elfNN_aarch64_late_size_sections () - - Iterate all input BFDS, look for in the local symbol data structure - constructed earlier for local TLS symbols and allocate them double -@@ -8976,8 +8976,8 @@ elfNN_aarch64_allocate_local_ifunc_dynre - though ! */ - - static bool --elfNN_aarch64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elfNN_aarch64_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_aarch64_link_hash_table *htab; - bfd *dynobj; -@@ -8988,7 +8988,8 @@ elfNN_aarch64_size_dynamic_sections (bfd - htab = elf_aarch64_hash_table ((info)); - dynobj = htab->root.dynobj; - -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->root.dynamic_sections_created) - { -@@ -9390,8 +9391,8 @@ elfNN_aarch64_create_small_pltn_entry (s - _TLS_MODULE_BASE_, if needed. */ - - static bool --elfNN_aarch64_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elfNN_aarch64_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - asection *tls_sec; - -@@ -10126,8 +10127,8 @@ const struct elf_size_info elfNN_aarch64 - #define elf_backend_adjust_dynamic_symbol \ - elfNN_aarch64_adjust_dynamic_symbol - --#define elf_backend_always_size_sections \ -- elfNN_aarch64_always_size_sections -+#define elf_backend_early_size_sections \ -+ elfNN_aarch64_early_size_sections - - #define elf_backend_check_relocs \ - elfNN_aarch64_check_relocs -@@ -10182,8 +10183,8 @@ const struct elf_size_info elfNN_aarch64 - #define elf_backend_modify_headers \ - elfNN_aarch64_modify_headers - --#define elf_backend_size_dynamic_sections \ -- elfNN_aarch64_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ elfNN_aarch64_late_size_sections - - #define elf_backend_size_info \ - elfNN_aarch64_size_info ---- a/bfd/elfnn-ia64.c -+++ b/bfd/elfnn-ia64.c -@@ -2986,8 +2986,8 @@ elfNN_ia64_adjust_dynamic_symbol (struct - } - - static bool --elfNN_ia64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elfNN_ia64_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elfNN_ia64_allocate_data data; - struct elfNN_ia64_link_hash_table *ia64_info; -@@ -2998,8 +2998,9 @@ elfNN_ia64_size_dynamic_sections (bfd *o - if (ia64_info == NULL) - return false; - dynobj = ia64_info->root.dynobj; -+ if (dynobj == NULL) -+ return true; - ia64_info->self_dtpmod_offset = (bfd_vma) -1; -- BFD_ASSERT(dynobj != NULL); - data.info = info; - - /* Set the contents of the .interp section to the interpreter. */ -@@ -5035,8 +5036,8 @@ ignore_errors (const char *fmt ATTRIBUTE - elfNN_ia64_check_relocs - #define elf_backend_adjust_dynamic_symbol \ - elfNN_ia64_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections \ -- elfNN_ia64_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ elfNN_ia64_late_size_sections - #define elf_backend_omit_section_dynsym \ - _bfd_elf_omit_section_dynsym_all - #define elf_backend_relocate_section \ ---- a/bfd/elfnn-loongarch.c -+++ b/bfd/elfnn-loongarch.c -@@ -1574,8 +1574,8 @@ maybe_set_textrel (struct elf_link_hash_ - } - - static bool --loongarch_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+loongarch_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - struct loongarch_elf_link_hash_table *htab; - bfd *dynobj; -@@ -1585,7 +1585,8 @@ loongarch_elf_size_dynamic_sections (bfd - htab = loongarch_elf_hash_table (info); - BFD_ASSERT (htab != NULL); - dynobj = htab->elf.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->elf.dynamic_sections_created) - { -@@ -4140,7 +4141,7 @@ elf_loongarch64_hash_symbol (struct elf_ - loongarch_elf_create_dynamic_sections - #define elf_backend_check_relocs loongarch_elf_check_relocs - #define elf_backend_adjust_dynamic_symbol loongarch_elf_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections loongarch_elf_size_dynamic_sections -+#define elf_backend_late_size_sections loongarch_elf_late_size_sections - #define elf_backend_relocate_section loongarch_elf_relocate_section - #define elf_backend_finish_dynamic_symbol loongarch_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections \ ---- a/bfd/elfnn-riscv.c -+++ b/bfd/elfnn-riscv.c -@@ -1348,7 +1348,7 @@ allocate_local_ifunc_dynrelocs (void **s - } - - static bool --riscv_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+riscv_elf_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - struct riscv_elf_link_hash_table *htab; - bfd *dynobj; -@@ -1358,7 +1358,8 @@ riscv_elf_size_dynamic_sections (bfd *ou - htab = riscv_elf_hash_table (info); - BFD_ASSERT (htab != NULL); - dynobj = htab->elf.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -5341,7 +5342,7 @@ riscv_elf_merge_symbol_attribute (struct - #define elf_backend_create_dynamic_sections riscv_elf_create_dynamic_sections - #define elf_backend_check_relocs riscv_elf_check_relocs - #define elf_backend_adjust_dynamic_symbol riscv_elf_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections riscv_elf_size_dynamic_sections -+#define elf_backend_late_size_sections riscv_elf_late_size_sections - #define elf_backend_relocate_section riscv_elf_relocate_section - #define elf_backend_finish_dynamic_symbol riscv_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections riscv_elf_finish_dynamic_sections ---- a/bfd/elfxx-mips.c -+++ b/bfd/elfxx-mips.c -@@ -9619,8 +9619,8 @@ _bfd_mips_elf_adjust_dynamic_symbol (str - check for any mips16 stub sections that we can discard. */ - - bool --_bfd_mips_elf_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+_bfd_mips_elf_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - asection *sect; - struct mips_elf_link_hash_table *htab; -@@ -9963,8 +9963,8 @@ mips_elf_set_plt_sym_value (struct mips_ - /* Set the sizes of the dynamic sections. */ - - bool --_bfd_mips_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+_bfd_mips_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s, *sreldyn; -@@ -9974,7 +9974,8 @@ _bfd_mips_elf_size_dynamic_sections (bfd - htab = mips_elf_hash_table (info); - BFD_ASSERT (htab != NULL); - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -14899,7 +14900,7 @@ _bfd_mips_elf_final_link (bfd *abfd, str - input_section->flags &= ~SEC_HAS_CONTENTS; - } - -- /* Size has been set in _bfd_mips_elf_always_size_sections. */ -+ /* Size has been set in _bfd_mips_elf_early_size_sections. */ - BFD_ASSERT(o->size == sizeof (Elf_External_ABIFlags_v0)); - - /* Skip this section later on (I don't think this currently -@@ -14958,7 +14959,7 @@ _bfd_mips_elf_final_link (bfd *abfd, str - input_section->flags &= ~SEC_HAS_CONTENTS; - } - -- /* Size has been set in _bfd_mips_elf_always_size_sections. */ -+ /* Size has been set in _bfd_mips_elf_early_size_sections. */ - BFD_ASSERT(o->size == sizeof (Elf32_External_RegInfo)); - - /* Skip this section later on (I don't think this currently ---- a/bfd/elfxx-mips.h -+++ b/bfd/elfxx-mips.h -@@ -61,9 +61,9 @@ extern bool _bfd_mips_elf_check_relocs - (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *); - extern bool _bfd_mips_elf_adjust_dynamic_symbol - (struct bfd_link_info *, struct elf_link_hash_entry *); --extern bool _bfd_mips_elf_always_size_sections -+extern bool _bfd_mips_elf_early_size_sections - (bfd *, struct bfd_link_info *); --extern bool _bfd_mips_elf_size_dynamic_sections -+extern bool _bfd_mips_elf_late_size_sections - (bfd *, struct bfd_link_info *); - extern int _bfd_mips_elf_relocate_section - (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, ---- a/bfd/elfxx-sparc.c -+++ b/bfd/elfxx-sparc.c -@@ -2381,8 +2381,8 @@ _bfd_sparc_elf_omit_section_dynsym (bfd - /* Set the sizes of the dynamic sections. */ - - bool --_bfd_sparc_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+_bfd_sparc_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - struct _bfd_sparc_elf_link_hash_table *htab; - bfd *dynobj; -@@ -2392,7 +2392,8 @@ _bfd_sparc_elf_size_dynamic_sections (bf - htab = _bfd_sparc_elf_hash_table (info); - BFD_ASSERT (htab != NULL); - dynobj = htab->elf.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { ---- a/bfd/elfxx-sparc.h -+++ b/bfd/elfxx-sparc.h -@@ -117,7 +117,7 @@ extern bool _bfd_sparc_elf_adjust_dynami - (struct bfd_link_info *, struct elf_link_hash_entry *); - extern bool _bfd_sparc_elf_omit_section_dynsym - (bfd *, struct bfd_link_info *, asection *); --extern bool _bfd_sparc_elf_size_dynamic_sections -+extern bool _bfd_sparc_elf_late_size_sections - (bfd *, struct bfd_link_info *); - extern bool _bfd_sparc_elf_new_section_hook - (bfd *, asection *); ---- a/bfd/elfxx-target.h -+++ b/bfd/elfxx-target.h -@@ -487,11 +487,11 @@ - #ifndef elf_backend_adjust_dynamic_symbol - #define elf_backend_adjust_dynamic_symbol 0 - #endif --#ifndef elf_backend_always_size_sections --#define elf_backend_always_size_sections 0 -+#ifndef elf_backend_early_size_sections -+#define elf_backend_early_size_sections 0 - #endif --#ifndef elf_backend_size_dynamic_sections --#define elf_backend_size_dynamic_sections 0 -+#ifndef elf_backend_late_size_sections -+#define elf_backend_late_size_sections 0 - #endif - #ifndef elf_backend_strip_zero_sized_dynamic_sections - #define elf_backend_strip_zero_sized_dynamic_sections 0 -@@ -849,8 +849,8 @@ static const struct elf_backend_data elf - elf_backend_check_directives, - elf_backend_notice_as_needed, - elf_backend_adjust_dynamic_symbol, -- elf_backend_always_size_sections, -- elf_backend_size_dynamic_sections, -+ elf_backend_early_size_sections, -+ elf_backend_late_size_sections, - elf_backend_strip_zero_sized_dynamic_sections, - elf_backend_init_index_section, - elf_backend_relocate_section, ---- a/bfd/elfxx-tilegx.c -+++ b/bfd/elfxx-tilegx.c -@@ -2430,8 +2430,8 @@ tilegx_elf_omit_section_dynsym (bfd *out - } - - bool --tilegx_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+tilegx_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct tilegx_elf_link_hash_table *htab; - bfd *dynobj; -@@ -2441,7 +2441,8 @@ tilegx_elf_size_dynamic_sections (bfd *o - htab = tilegx_elf_hash_table (info); - BFD_ASSERT (htab != NULL); - dynobj = htab->elf.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { ---- a/bfd/elfxx-tilegx.h -+++ b/bfd/elfxx-tilegx.h -@@ -57,7 +57,7 @@ tilegx_elf_omit_section_dynsym (bfd *, - asection *); - - extern bool --tilegx_elf_size_dynamic_sections (bfd *, struct bfd_link_info *); -+tilegx_elf_late_size_sections (bfd *, struct bfd_link_info *); - - extern int - tilegx_elf_relocate_section (bfd *, struct bfd_link_info *, ---- a/bfd/elfxx-x86.c -+++ b/bfd/elfxx-x86.c -@@ -2225,7 +2225,7 @@ _bfd_elf_x86_valid_reloc_p (asection *in - /* Set the sizes of the dynamic sections. */ - - bool --_bfd_x86_elf_size_dynamic_sections (bfd *output_bfd, -+_bfd_x86_elf_late_size_sections (bfd *output_bfd, - struct bfd_link_info *info) - { - struct elf_x86_link_hash_table *htab; -@@ -2241,7 +2241,7 @@ _bfd_x86_elf_size_dynamic_sections (bfd - return false; - dynobj = htab->elf.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - /* Set up .got offsets for local syms, and space for local dynamic - relocs. */ -@@ -2948,8 +2948,8 @@ _bfd_x86_elf_finish_dynamic_sections (bf - - - bool --_bfd_x86_elf_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+_bfd_x86_elf_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - asection *tls_sec = elf_hash_table (info)->tls_sec; - ---- a/bfd/elfxx-x86.h -+++ b/bfd/elfxx-x86.h -@@ -854,13 +854,13 @@ extern bool _bfd_elf_x86_valid_reloc_p - const Elf_Internal_Rela *, struct elf_link_hash_entry *, - Elf_Internal_Sym *, Elf_Internal_Shdr *, bool *); - --extern bool _bfd_x86_elf_size_dynamic_sections -+extern bool _bfd_x86_elf_late_size_sections - (bfd *, struct bfd_link_info *); - - extern struct elf_x86_link_hash_table *_bfd_x86_elf_finish_dynamic_sections - (bfd *, struct bfd_link_info *); - --extern bool _bfd_x86_elf_always_size_sections -+extern bool _bfd_x86_elf_early_size_sections - (bfd *, struct bfd_link_info *); - - extern void _bfd_x86_elf_merge_symbol_attribute -@@ -932,8 +932,8 @@ extern void _bfd_x86_elf_link_report_rel - - #define elf_backend_check_relocs \ - _bfd_x86_elf_check_relocs --#define elf_backend_size_dynamic_sections \ -- _bfd_x86_elf_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ _bfd_x86_elf_late_size_sections - #define elf_backend_merge_symbol_attribute \ - _bfd_x86_elf_merge_symbol_attribute - #define elf_backend_copy_indirect_symbol \ ---- a/ld/emultempl/vms.em -+++ b/ld/emultempl/vms.em -@@ -196,10 +196,9 @@ gld${EMULATION_NAME}_before_allocation ( - - /* The backend must work out the sizes of all the other dynamic - sections. */ -- if (elf_hash_table (&link_info)->dynamic_sections_created -- && bed->elf_backend_size_dynamic_sections -- && ! (*bed->elf_backend_size_dynamic_sections) (link_info.output_bfd, -- &link_info)) -+ if (bed->elf_backend_late_size_sections -+ && !bed->elf_backend_late_size_sections (link_info.output_bfd, -+ &link_info)) - einfo (_("%F%P: failed to set dynamic section sizes: %E\n")); - - before_allocation_default (); diff --git a/toolchain/binutils/patches/2.40/002-PR-30569-delete-_bfd_mips_elf_early_size_sections.patch b/toolchain/binutils/patches/2.40/002-PR-30569-delete-_bfd_mips_elf_early_size_sections.patch deleted file mode 100644 index 8e5f1b76c6..0000000000 --- a/toolchain/binutils/patches/2.40/002-PR-30569-delete-_bfd_mips_elf_early_size_sections.patch +++ /dev/null @@ -1,218 +0,0 @@ -From 3c6c32951e292a51ede70b8087bb0308d7dbc4fc Mon Sep 17 00:00:00 2001 -From: Alan Modra <amodra@gmail.com> -Date: Thu, 28 Mar 2024 20:33:32 +1030 -Subject: [PATCH 2/2] PR 30569, delete _bfd_mips_elf_early_size_sections - -PR30569 was triggered by a patch of mine 6540edd52cc0 moving the call -to always_size_sections in bfd_elf_size_dynamic_sections earlier, made -to support the x86 DT_RELR implementation. This broke mips16 code -handling stubs when --export-dynamic is passed to the linker, because -numerous symbols then became dynamic after always_size_sections. The -mips backend fiddles with symbols in its always_size_sections. Maciej -in 902e9fc76a0e had moved the call to always_size_sections to after -the export-dynamic code. Prior to that, Nathan in 04c3a75556c0 moved -it before the exec stack code, back to the start of -bfd_elf_size_dynamic_sections which was where Ian put it originally -in ff12f303355b. So the call has moved around a little. I'm leaving -it where it is, and instead calling mips_elf_check_symbols from -late_size_sections (the old size_dynamic_sections) which is now always -called. In fact, the whole of _bfd_mips_elf_early_size_sections can -be merged into _bfd_mips_elf_late_size_sections. ---- - bfd/elf32-mips.c | 1 - - bfd/elf64-mips.c | 2 -- - bfd/elfn32-mips.c | 1 - - bfd/elfxx-mips.c | 84 +++++++++++++++++++---------------------------- - bfd/elfxx-mips.h | 2 -- - 5 files changed, 34 insertions(+), 56 deletions(-) - ---- a/bfd/elf32-mips.c -+++ b/bfd/elf32-mips.c -@@ -2534,7 +2534,6 @@ static const struct ecoff_debug_swap mip - #define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mips_elf_adjust_dynamic_symbol --#define elf_backend_early_size_sections _bfd_mips_elf_early_size_sections - #define elf_backend_late_size_sections _bfd_mips_elf_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section _bfd_mips_elf_relocate_section ---- a/bfd/elf64-mips.c -+++ b/bfd/elf64-mips.c -@@ -4745,8 +4745,6 @@ const struct elf_size_info mips_elf64_si - #define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mips_elf_adjust_dynamic_symbol --#define elf_backend_early_size_sections \ -- _bfd_mips_elf_early_size_sections - #define elf_backend_late_size_sections \ - _bfd_mips_elf_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section ---- a/bfd/elfn32-mips.c -+++ b/bfd/elfn32-mips.c -@@ -4131,7 +4131,6 @@ static const struct ecoff_debug_swap mip - #define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mips_elf_adjust_dynamic_symbol --#define elf_backend_early_size_sections _bfd_mips_elf_early_size_sections - #define elf_backend_late_size_sections _bfd_mips_elf_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section _bfd_mips_elf_relocate_section ---- a/bfd/elfxx-mips.c -+++ b/bfd/elfxx-mips.c -@@ -9614,48 +9614,6 @@ _bfd_mips_elf_adjust_dynamic_symbol (str - return _bfd_elf_adjust_dynamic_copy (info, h, s); - } - --/* This function is called after all the input files have been read, -- and the input sections have been assigned to output sections. We -- check for any mips16 stub sections that we can discard. */ -- --bool --_bfd_mips_elf_early_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) --{ -- asection *sect; -- struct mips_elf_link_hash_table *htab; -- struct mips_htab_traverse_info hti; -- -- htab = mips_elf_hash_table (info); -- BFD_ASSERT (htab != NULL); -- -- /* The .reginfo section has a fixed size. */ -- sect = bfd_get_section_by_name (output_bfd, ".reginfo"); -- if (sect != NULL) -- { -- bfd_set_section_size (sect, sizeof (Elf32_External_RegInfo)); -- sect->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS; -- } -- -- /* The .MIPS.abiflags section has a fixed size. */ -- sect = bfd_get_section_by_name (output_bfd, ".MIPS.abiflags"); -- if (sect != NULL) -- { -- bfd_set_section_size (sect, sizeof (Elf_External_ABIFlags_v0)); -- sect->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS; -- } -- -- hti.info = info; -- hti.output_bfd = output_bfd; -- hti.error = false; -- mips_elf_link_hash_traverse (mips_elf_hash_table (info), -- mips_elf_check_symbols, &hti); -- if (hti.error) -- return false; -- -- return true; --} -- - /* If the link uses a GOT, lay it out and work out its size. */ - - static bool -@@ -9960,7 +9918,8 @@ mips_elf_set_plt_sym_value (struct mips_ - return true; - } - --/* Set the sizes of the dynamic sections. */ -+/* Set the sizes of the dynamic sections, some mips non-dynamic sections, -+ and check for any mips16 stub sections that we can discard. */ - - bool - _bfd_mips_elf_late_size_sections (bfd *output_bfd, -@@ -9970,14 +9929,39 @@ _bfd_mips_elf_late_size_sections (bfd *o - asection *s, *sreldyn; - bool reltext; - struct mips_elf_link_hash_table *htab; -+ struct mips_htab_traverse_info hti; - - htab = mips_elf_hash_table (info); - BFD_ASSERT (htab != NULL); -- dynobj = elf_hash_table (info)->dynobj; -+ -+ /* The .reginfo section has a fixed size. */ -+ s = bfd_get_section_by_name (output_bfd, ".reginfo"); -+ if (s != NULL) -+ { -+ bfd_set_section_size (s, sizeof (Elf32_External_RegInfo)); -+ s->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS; -+ } -+ -+ /* The .MIPS.abiflags section has a fixed size. */ -+ s = bfd_get_section_by_name (output_bfd, ".MIPS.abiflags"); -+ if (s != NULL) -+ { -+ bfd_set_section_size (s, sizeof (Elf_External_ABIFlags_v0)); -+ s->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS; -+ } -+ -+ hti.info = info; -+ hti.output_bfd = output_bfd; -+ hti.error = false; -+ mips_elf_link_hash_traverse (htab, mips_elf_check_symbols, &hti); -+ if (hti.error) -+ return false; -+ -+ dynobj = htab->root.dynobj; - if (dynobj == NULL) - return true; - -- if (elf_hash_table (info)->dynamic_sections_created) -+ if (htab->root.dynamic_sections_created) - { - /* Set the contents of the .interp section to the interpreter. */ - if (bfd_link_executable (info) && !info->nointerp) -@@ -10117,7 +10101,7 @@ _bfd_mips_elf_late_size_sections (bfd *o - } - } - else if (bfd_link_executable (info) -- && ! mips_elf_hash_table (info)->use_rld_obj_head -+ && !htab->use_rld_obj_head - && startswith (name, ".rld_map")) - { - /* We add a room for __rld_map. It will be filled in by the -@@ -10126,7 +10110,7 @@ _bfd_mips_elf_late_size_sections (bfd *o - } - else if (SGI_COMPAT (output_bfd) - && startswith (name, ".compact_rel")) -- s->size += mips_elf_hash_table (info)->compact_rel_size; -+ s->size += htab->compact_rel_size; - else if (s == htab->root.splt) - { - /* If the last PLT entry has a branch delay slot, allocate -@@ -10166,7 +10150,7 @@ _bfd_mips_elf_late_size_sections (bfd *o - } - } - -- if (elf_hash_table (info)->dynamic_sections_created) -+ if (htab->root.dynamic_sections_created) - { - /* Add some entries to the .dynamic section. We fill in the - values later, in _bfd_mips_elf_finish_dynamic_sections, but we -@@ -14900,7 +14884,7 @@ _bfd_mips_elf_final_link (bfd *abfd, str - input_section->flags &= ~SEC_HAS_CONTENTS; - } - -- /* Size has been set in _bfd_mips_elf_early_size_sections. */ -+ /* Size has been set in _bfd_mips_elf_late_size_sections. */ - BFD_ASSERT(o->size == sizeof (Elf_External_ABIFlags_v0)); - - /* Skip this section later on (I don't think this currently -@@ -14959,7 +14943,7 @@ _bfd_mips_elf_final_link (bfd *abfd, str - input_section->flags &= ~SEC_HAS_CONTENTS; - } - -- /* Size has been set in _bfd_mips_elf_early_size_sections. */ -+ /* Size has been set in _bfd_mips_elf_late_size_sections. */ - BFD_ASSERT(o->size == sizeof (Elf32_External_RegInfo)); - - /* Skip this section later on (I don't think this currently ---- a/bfd/elfxx-mips.h -+++ b/bfd/elfxx-mips.h -@@ -61,8 +61,6 @@ extern bool _bfd_mips_elf_check_relocs - (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *); - extern bool _bfd_mips_elf_adjust_dynamic_symbol - (struct bfd_link_info *, struct elf_link_hash_entry *); --extern bool _bfd_mips_elf_early_size_sections -- (bfd *, struct bfd_link_info *); - extern bool _bfd_mips_elf_late_size_sections - (bfd *, struct bfd_link_info *); - extern int _bfd_mips_elf_relocate_section diff --git a/toolchain/binutils/patches/2.40/005-libctf-update-regexp-to-allow-makeinfo-to-build-docu.patch b/toolchain/binutils/patches/2.40/005-libctf-update-regexp-to-allow-makeinfo-to-build-docu.patch deleted file mode 100644 index 19af34091c..0000000000 --- a/toolchain/binutils/patches/2.40/005-libctf-update-regexp-to-allow-makeinfo-to-build-docu.patch +++ /dev/null @@ -1,70 +0,0 @@ -From f7c5db99b76e8dde89335d794c82fcbfbf53c612 Mon Sep 17 00:00:00 2001 -From: Enze Li <enze.li@hotmail.com> -Date: Sat, 14 Jan 2023 11:33:48 +0800 -Subject: [PATCH 05/50] libctf: update regexp to allow makeinfo to build - document - -While trying to build gdb on latest openSUSE Tumbleweed, I noticed the -following warning, - - checking for makeinfo... makeinfo --split-size=5000000 - configure: WARNING: - *** Makeinfo is too old. Info documentation will not be built. - -then I checked the version of makeinfo, it said, -====== -$ makeinfo --version -texi2any (GNU texinfo) 7.0.1 - -Copyright (C) 2022 Free Software Foundation, Inc. -License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> -This is free software: you are free to change and redistribute it. -There is NO WARRANTY, to the extent permitted by law. -====== - -After digging a little bit, it became quite obvious that a dot is -missing in regexp that makes it impossible to match versions higher than -7.0, and here's the solution: - -- | egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9][0-9])' >/dev/null 2>&1; then -+ | egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9]\.[0-9])' >/dev/null 2>&1; then - -However, Eli pointed out that the solution above has another problem: it -will stop working when Texinfo 10.1 will be released. Meanwhile, he -suggested to solve this problem permanently. That is, we don't care -about the minor version for Texinfo > 6.9, we only care about the major -version. - -In this way, the problem will be resolved permanently, thanks to Eli. - -libctf/ChangeLog: - - * configure: Regenerated. - * configure.ac: Update regexp to match versions higher than 7.0. ---- - libctf/configure | 2 +- - libctf/configure.ac | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - ---- a/libctf/configure -+++ b/libctf/configure -@@ -14865,7 +14865,7 @@ esac - # We require texinfo to be 6.3 or later, for a working synindex - # and validatemenus: otherwise we fall back to /bin/true. - if ${MAKEINFO} --version \ -- | egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9][0-9])' >/dev/null 2>&1; then -+ | egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9]|[1-6][0-9])' >/dev/null 2>&1; then - build_info=yes - else - build_info= ---- a/libctf/configure.ac -+++ b/libctf/configure.ac -@@ -184,7 +184,7 @@ changequote(,) - # We require texinfo to be 6.3 or later, for a working synindex - # and validatemenus: otherwise we fall back to /bin/true. - if ${MAKEINFO} --version \ -- | egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9][0-9])' >/dev/null 2>&1; then -+ | egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9]|[1-6][0-9])' >/dev/null 2>&1; then - build_info=yes - else - build_info= diff --git a/toolchain/binutils/patches/2.40/007-Fix-version-number-snafu-in-some-configuration-files.patch b/toolchain/binutils/patches/2.40/007-Fix-version-number-snafu-in-some-configuration-files.patch deleted file mode 100644 index 0676240442..0000000000 --- a/toolchain/binutils/patches/2.40/007-Fix-version-number-snafu-in-some-configuration-files.patch +++ /dev/null @@ -1,444 +0,0 @@ -From 59706683feafb6252d0ad369cf8759f75fd147be Mon Sep 17 00:00:00 2001 -From: Nick Clifton <nickc@redhat.com> -Date: Tue, 17 Jan 2023 12:02:56 +0000 -Subject: [PATCH 07/50] Fix version number snafu in some configuration files: - 2.40.00 should be 2.40 - ---- - binutils/configure | 20 ++++++++++---------- - gprof/configure | 20 ++++++++++---------- - gprofng/configure | 20 ++++++++++---------- - gprofng/doc/version.texi | 4 ++-- - gprofng/libcollector/configure | 20 ++++++++++---------- - ld/configure | 20 ++++++++++---------- - 6 files changed, 52 insertions(+), 52 deletions(-) - ---- a/binutils/configure -+++ b/binutils/configure -@@ -1,6 +1,6 @@ - #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. --# Generated by GNU Autoconf 2.69 for binutils 2.40.00. -+# Generated by GNU Autoconf 2.69 for binutils 2.40. - # - # - # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -@@ -587,8 +587,8 @@ MAKEFLAGS= - # Identity of this package. - PACKAGE_NAME='binutils' - PACKAGE_TARNAME='binutils' --PACKAGE_VERSION='2.40.00' --PACKAGE_STRING='binutils 2.40.00' -+PACKAGE_VERSION='2.40' -+PACKAGE_STRING='binutils 2.40' - PACKAGE_BUGREPORT='' - PACKAGE_URL='' - -@@ -1401,7 +1401,7 @@ if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF --\`configure' configures binutils 2.40.00 to adapt to many kinds of systems. -+\`configure' configures binutils 2.40 to adapt to many kinds of systems. - - Usage: $0 [OPTION]... [VAR=VALUE]... - -@@ -1472,7 +1472,7 @@ fi - - if test -n "$ac_init_help"; then - case $ac_init_help in -- short | recursive ) echo "Configuration of binutils 2.40.00:";; -+ short | recursive ) echo "Configuration of binutils 2.40:";; - esac - cat <<\_ACEOF - -@@ -1631,7 +1631,7 @@ fi - test -n "$ac_init_help" && exit $ac_status - if $ac_init_version; then - cat <<\_ACEOF --binutils configure 2.40.00 -+binutils configure 2.40 - generated by GNU Autoconf 2.69 - - Copyright (C) 2012 Free Software Foundation, Inc. -@@ -2099,7 +2099,7 @@ cat >config.log <<_ACEOF - This file contains any messages produced by compilers while - running configure, to aid debugging if configure makes a mistake. - --It was created by binutils $as_me 2.40.00, which was -+It was created by binutils $as_me 2.40, which was - generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ -@@ -3081,7 +3081,7 @@ fi - - # Define the identity of the package. - PACKAGE='binutils' -- VERSION='2.40.00' -+ VERSION='2.40' - - - cat >>confdefs.h <<_ACEOF -@@ -15326,7 +15326,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri - # report actual input values of CONFIG_FILES etc. instead of their - # values after options handling. - ac_log=" --This file was extended by binutils $as_me 2.40.00, which was -+This file was extended by binutils $as_me 2.40, which was - generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES -@@ -15392,7 +15392,7 @@ _ACEOF - cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" - ac_cs_version="\\ --binutils config.status 2.40.00 -+binutils config.status 2.40 - configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - ---- a/gprof/configure -+++ b/gprof/configure -@@ -1,6 +1,6 @@ - #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. --# Generated by GNU Autoconf 2.69 for gprof 2.40.00. -+# Generated by GNU Autoconf 2.69 for gprof 2.40. - # - # - # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -@@ -587,8 +587,8 @@ MAKEFLAGS= - # Identity of this package. - PACKAGE_NAME='gprof' - PACKAGE_TARNAME='gprof' --PACKAGE_VERSION='2.40.00' --PACKAGE_STRING='gprof 2.40.00' -+PACKAGE_VERSION='2.40' -+PACKAGE_STRING='gprof 2.40' - PACKAGE_BUGREPORT='' - PACKAGE_URL='' - -@@ -1338,7 +1338,7 @@ if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF --\`configure' configures gprof 2.40.00 to adapt to many kinds of systems. -+\`configure' configures gprof 2.40 to adapt to many kinds of systems. - - Usage: $0 [OPTION]... [VAR=VALUE]... - -@@ -1409,7 +1409,7 @@ fi - - if test -n "$ac_init_help"; then - case $ac_init_help in -- short | recursive ) echo "Configuration of gprof 2.40.00:";; -+ short | recursive ) echo "Configuration of gprof 2.40:";; - esac - cat <<\_ACEOF - -@@ -1520,7 +1520,7 @@ fi - test -n "$ac_init_help" && exit $ac_status - if $ac_init_version; then - cat <<\_ACEOF --gprof configure 2.40.00 -+gprof configure 2.40 - generated by GNU Autoconf 2.69 - - Copyright (C) 2012 Free Software Foundation, Inc. -@@ -1885,7 +1885,7 @@ cat >config.log <<_ACEOF - This file contains any messages produced by compilers while - running configure, to aid debugging if configure makes a mistake. - --It was created by gprof $as_me 2.40.00, which was -+It was created by gprof $as_me 2.40, which was - generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ -@@ -2864,7 +2864,7 @@ fi - - # Define the identity of the package. - PACKAGE='gprof' -- VERSION='2.40.00' -+ VERSION='2.40' - - - cat >>confdefs.h <<_ACEOF -@@ -12572,7 +12572,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri - # report actual input values of CONFIG_FILES etc. instead of their - # values after options handling. - ac_log=" --This file was extended by gprof $as_me 2.40.00, which was -+This file was extended by gprof $as_me 2.40, which was - generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES -@@ -12638,7 +12638,7 @@ _ACEOF - cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" - ac_cs_version="\\ --gprof config.status 2.40.00 -+gprof config.status 2.40 - configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - ---- a/gprofng/configure -+++ b/gprofng/configure -@@ -1,6 +1,6 @@ - #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. --# Generated by GNU Autoconf 2.69 for gprofng 2.40.00. -+# Generated by GNU Autoconf 2.69 for gprofng 2.40. - # - # - # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -@@ -587,8 +587,8 @@ MAKEFLAGS= - # Identity of this package. - PACKAGE_NAME='gprofng' - PACKAGE_TARNAME='gprofng' --PACKAGE_VERSION='2.40.00' --PACKAGE_STRING='gprofng 2.40.00' -+PACKAGE_VERSION='2.40' -+PACKAGE_STRING='gprofng 2.40' - PACKAGE_BUGREPORT='' - PACKAGE_URL='' - -@@ -1362,7 +1362,7 @@ if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF --\`configure' configures gprofng 2.40.00 to adapt to many kinds of systems. -+\`configure' configures gprofng 2.40 to adapt to many kinds of systems. - - Usage: $0 [OPTION]... [VAR=VALUE]... - -@@ -1433,7 +1433,7 @@ fi - - if test -n "$ac_init_help"; then - case $ac_init_help in -- short | recursive ) echo "Configuration of gprofng 2.40.00:";; -+ short | recursive ) echo "Configuration of gprofng 2.40:";; - esac - cat <<\_ACEOF - -@@ -1547,7 +1547,7 @@ fi - test -n "$ac_init_help" && exit $ac_status - if $ac_init_version; then - cat <<\_ACEOF --gprofng configure 2.40.00 -+gprofng configure 2.40 - generated by GNU Autoconf 2.69 - - Copyright (C) 2012 Free Software Foundation, Inc. -@@ -2079,7 +2079,7 @@ cat >config.log <<_ACEOF - This file contains any messages produced by compilers while - running configure, to aid debugging if configure makes a mistake. - --It was created by gprofng $as_me 2.40.00, which was -+It was created by gprofng $as_me 2.40, which was - generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ -@@ -3052,7 +3052,7 @@ fi - - # Define the identity of the package. - PACKAGE='gprofng' -- VERSION='2.40.00' -+ VERSION='2.40' - - - cat >>confdefs.h <<_ACEOF -@@ -17467,7 +17467,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri - # report actual input values of CONFIG_FILES etc. instead of their - # values after options handling. - ac_log=" --This file was extended by gprofng $as_me 2.40.00, which was -+This file was extended by gprofng $as_me 2.40, which was - generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES -@@ -17533,7 +17533,7 @@ _ACEOF - cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" - ac_cs_version="\\ --gprofng config.status 2.40.00 -+gprofng config.status 2.40 - configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - ---- a/gprofng/doc/version.texi -+++ b/gprofng/doc/version.texi -@@ -1,4 +1,4 @@ - @set UPDATED 5 January 2023 - @set UPDATED-MONTH January 2023 --@set EDITION 2.40.00 --@set VERSION 2.40.00 -+@set EDITION 2.40 -+@set VERSION 2.40 ---- a/gprofng/libcollector/configure -+++ b/gprofng/libcollector/configure -@@ -1,6 +1,6 @@ - #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. --# Generated by GNU Autoconf 2.69 for gprofng 2.40.00. -+# Generated by GNU Autoconf 2.69 for gprofng 2.40. - # - # - # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -@@ -587,8 +587,8 @@ MAKEFLAGS= - # Identity of this package. - PACKAGE_NAME='gprofng' - PACKAGE_TARNAME='gprofng' --PACKAGE_VERSION='2.40.00' --PACKAGE_STRING='gprofng 2.40.00' -+PACKAGE_VERSION='2.40' -+PACKAGE_STRING='gprofng 2.40' - PACKAGE_BUGREPORT='' - PACKAGE_URL='' - -@@ -1325,7 +1325,7 @@ if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF --\`configure' configures gprofng 2.40.00 to adapt to many kinds of systems. -+\`configure' configures gprofng 2.40 to adapt to many kinds of systems. - - Usage: $0 [OPTION]... [VAR=VALUE]... - -@@ -1396,7 +1396,7 @@ fi - - if test -n "$ac_init_help"; then - case $ac_init_help in -- short | recursive ) echo "Configuration of gprofng 2.40.00:";; -+ short | recursive ) echo "Configuration of gprofng 2.40:";; - esac - cat <<\_ACEOF - -@@ -1505,7 +1505,7 @@ fi - test -n "$ac_init_help" && exit $ac_status - if $ac_init_version; then - cat <<\_ACEOF --gprofng configure 2.40.00 -+gprofng configure 2.40 - generated by GNU Autoconf 2.69 - - Copyright (C) 2012 Free Software Foundation, Inc. -@@ -1991,7 +1991,7 @@ cat >config.log <<_ACEOF - This file contains any messages produced by compilers while - running configure, to aid debugging if configure makes a mistake. - --It was created by gprofng $as_me 2.40.00, which was -+It was created by gprofng $as_me 2.40, which was - generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ -@@ -2968,7 +2968,7 @@ fi - - # Define the identity of the package. - PACKAGE='gprofng' -- VERSION='2.40.00' -+ VERSION='2.40' - - - cat >>confdefs.h <<_ACEOF -@@ -16098,7 +16098,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri - # report actual input values of CONFIG_FILES etc. instead of their - # values after options handling. - ac_log=" --This file was extended by gprofng $as_me 2.40.00, which was -+This file was extended by gprofng $as_me 2.40, which was - generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES -@@ -16164,7 +16164,7 @@ _ACEOF - cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" - ac_cs_version="\\ --gprofng config.status 2.40.00 -+gprofng config.status 2.40 - configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - ---- a/ld/configure -+++ b/ld/configure -@@ -1,6 +1,6 @@ - #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. --# Generated by GNU Autoconf 2.69 for ld 2.40.00. -+# Generated by GNU Autoconf 2.69 for ld 2.40. - # - # - # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -@@ -587,8 +587,8 @@ MAKEFLAGS= - # Identity of this package. - PACKAGE_NAME='ld' - PACKAGE_TARNAME='ld' --PACKAGE_VERSION='2.40.00' --PACKAGE_STRING='ld 2.40.00' -+PACKAGE_VERSION='2.40' -+PACKAGE_STRING='ld 2.40' - PACKAGE_BUGREPORT='' - PACKAGE_URL='' - -@@ -1423,7 +1423,7 @@ if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF --\`configure' configures ld 2.40.00 to adapt to many kinds of systems. -+\`configure' configures ld 2.40 to adapt to many kinds of systems. - - Usage: $0 [OPTION]... [VAR=VALUE]... - -@@ -1494,7 +1494,7 @@ fi - - if test -n "$ac_init_help"; then - case $ac_init_help in -- short | recursive ) echo "Configuration of ld 2.40.00:";; -+ short | recursive ) echo "Configuration of ld 2.40:";; - esac - cat <<\_ACEOF - -@@ -1661,7 +1661,7 @@ fi - test -n "$ac_init_help" && exit $ac_status - if $ac_init_version; then - cat <<\_ACEOF --ld configure 2.40.00 -+ld configure 2.40 - generated by GNU Autoconf 2.69 - - Copyright (C) 2012 Free Software Foundation, Inc. -@@ -2376,7 +2376,7 @@ cat >config.log <<_ACEOF - This file contains any messages produced by compilers while - running configure, to aid debugging if configure makes a mistake. - --It was created by ld $as_me 2.40.00, which was -+It was created by ld $as_me 2.40, which was - generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ -@@ -3359,7 +3359,7 @@ fi - - # Define the identity of the package. - PACKAGE='ld' -- VERSION='2.40.00' -+ VERSION='2.40' - - - cat >>confdefs.h <<_ACEOF -@@ -18083,7 +18083,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri - # report actual input values of CONFIG_FILES etc. instead of their - # values after options handling. - ac_log=" --This file was extended by ld $as_me 2.40.00, which was -+This file was extended by ld $as_me 2.40, which was - generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES -@@ -18149,7 +18149,7 @@ _ACEOF - cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" - ac_cs_version="\\ --ld config.status 2.40.00 -+ld config.status 2.40 - configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - diff --git a/toolchain/binutils/patches/2.40/010-toplevel-Makefile.def-add-install-strip-dependency-o.patch b/toolchain/binutils/patches/2.40/010-toplevel-Makefile.def-add-install-strip-dependency-o.patch deleted file mode 100644 index bef40f546f..0000000000 --- a/toolchain/binutils/patches/2.40/010-toplevel-Makefile.def-add-install-strip-dependency-o.patch +++ /dev/null @@ -1,60 +0,0 @@ -From bcea253f5fa194e57f9564e8461c718e228bd26e Mon Sep 17 00:00:00 2001 -From: Indu Bhagat <indu.bhagat@oracle.com> -Date: Wed, 18 Jan 2023 23:17:49 -0800 -Subject: [PATCH 10/50] toplevel: Makefile.def: add install-strip dependency on - libsframe - -As noted in PR libsframe/30014 - FTBFS: install-strip fails because -bfdlib relinks and fails to find libsframe, the install time -dependencies of libbfd need to be updated. - - PR libsframe/30014 - * Makefile.def: Reflect that libsframe needs to installed before - libbfd. Reorder a bit to better track libsframe dependencies. - * Makefile.in: Regenerate. - -(cherry picked from commit b8d21eb0cd10d6127e77cc437d82e949adb0c454) ---- - Makefile.def | 5 ++++- - Makefile.in | 3 ++- - 2 files changed, 6 insertions(+), 2 deletions(-) - ---- a/Makefile.def -+++ b/Makefile.def -@@ -493,7 +493,6 @@ dependencies = { module=install-binutils - dependencies = { module=install-strip-binutils; on=install-strip-opcodes; }; - - // Likewise for ld, libctf, and bfd. --dependencies = { module=install-bfd; on=install-libsframe; }; - dependencies = { module=install-libctf; on=install-bfd; }; - dependencies = { module=install-ld; on=install-bfd; }; - dependencies = { module=install-ld; on=install-libctf; }; -@@ -501,6 +500,10 @@ dependencies = { module=install-strip-li - dependencies = { module=install-strip-ld; on=install-strip-bfd; }; - dependencies = { module=install-strip-ld; on=install-strip-libctf; }; - -+// libbfd depends on libsframe -+dependencies = { module=install-bfd; on=install-libsframe; }; -+dependencies = { module=install-strip-bfd; on=install-strip-libsframe; }; -+ - // libopcodes depends on libbfd - dependencies = { module=configure-opcodes; on=configure-bfd; hard=true; }; - dependencies = { module=install-opcodes; on=install-bfd; }; ---- a/Makefile.in -+++ b/Makefile.in -@@ -64549,13 +64549,14 @@ all-stageautoprofile-binutils: maybe-all - all-stageautofeedback-binutils: maybe-all-stageautofeedback-libsframe - install-binutils: maybe-install-opcodes - install-strip-binutils: maybe-install-strip-opcodes --install-bfd: maybe-install-libsframe - install-libctf: maybe-install-bfd - install-ld: maybe-install-bfd - install-ld: maybe-install-libctf - install-strip-libctf: maybe-install-strip-bfd - install-strip-ld: maybe-install-strip-bfd - install-strip-ld: maybe-install-strip-libctf -+install-bfd: maybe-install-libsframe -+install-strip-bfd: maybe-install-strip-libsframe - configure-opcodes: configure-bfd - configure-stage1-opcodes: configure-stage1-bfd - configure-stage2-opcodes: configure-stage2-bfd diff --git a/toolchain/binutils/patches/2.40/018-gprofng-PR29521-docs-man-pages-are-not-in-the-releas.patch b/toolchain/binutils/patches/2.40/018-gprofng-PR29521-docs-man-pages-are-not-in-the-releas.patch deleted file mode 100644 index ae557645c0..0000000000 --- a/toolchain/binutils/patches/2.40/018-gprofng-PR29521-docs-man-pages-are-not-in-the-releas.patch +++ /dev/null @@ -1,703 +0,0 @@ -From c6e269febbc946a54ed9dbbb2dc70feba6017607 Mon Sep 17 00:00:00 2001 -From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com> -Date: Fri, 20 Jan 2023 15:39:55 -0800 -Subject: [PATCH 18/50] gprofng: PR29521 [docs] man pages are not in the - release tarball - -gprofng/ChangeLog -2023-01-20 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> - - PR gprofng/29521 - * configure.ac: Check if $MAKEINFO and $HELP2MAN are missing. - * Makefile.am: Build doc if $MAKEINFO exists. - * doc/gprofng.texi: Update documentation for gprofng. - * doc/Makefile.am: Build gprofng.1. - * src/Makefile.am: Move the build of gprofng.1 to doc/Makefile.am. - * configure: Rebuild. - * Makefile.in: Rebuild. - * doc/Makefile.in: Rebuild. - * src/Makefile.in: Rebuild. ---- - gprofng/Makefile.am | 2 +- - gprofng/Makefile.in | 2 +- - gprofng/configure | 79 +++++++++++++++--- - gprofng/configure.ac | 21 +++-- - gprofng/doc/Makefile.am | 24 +++++- - gprofng/doc/Makefile.in | 93 ++++++++++++++++++--- - gprofng/doc/gprofng.texi | 169 +++++++++++++++++++++++++++++++++++++++ - gprofng/src/Makefile.am | 8 +- - gprofng/src/Makefile.in | 8 +- - 9 files changed, 364 insertions(+), 42 deletions(-) - ---- a/gprofng/Makefile.am -+++ b/gprofng/Makefile.am -@@ -23,7 +23,7 @@ AUTOMAKE_OPTIONS = dejagnu foreign - if BUILD_COLLECTOR - COLLECTOR_SUBDIRS = libcollector - endif --if BUILD_MAN -+if BUILD_DOC - DOC_SUBDIR = doc - endif - if BUILD_SRC ---- a/gprofng/Makefile.in -+++ b/gprofng/Makefile.in -@@ -381,7 +381,7 @@ zlibinc = @zlibinc@ - ACLOCAL_AMFLAGS = -I . -I .. - AUTOMAKE_OPTIONS = dejagnu foreign - @BUILD_COLLECTOR_TRUE@COLLECTOR_SUBDIRS = libcollector --@BUILD_MAN_TRUE@DOC_SUBDIR = doc -+@BUILD_DOC_TRUE@DOC_SUBDIR = doc - @BUILD_SRC_TRUE@SRC_SUBDIRS = src gp-display-html $(DOC_SUBDIR) - SUBDIRS = $(COLLECTOR_SUBDIRS) $(SRC_SUBDIRS) - DIST_SUBDIRS = libcollector src gp-display-html $(DOC_SUBDIR) ---- a/gprofng/configure -+++ b/gprofng/configure -@@ -639,6 +639,8 @@ GPROFNG_CPPFLAGS - GPROFNG_NO_FORMAT_TRUNCATION_CFLAGS - GPROFNG_CFLAGS - LD_NO_AS_NEEDED -+BUILD_DOC_FALSE -+BUILD_DOC_TRUE - BUILD_MAN_FALSE - BUILD_MAN_TRUE - HELP2MAN -@@ -12221,7 +12223,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 12224 "configure" -+#line 12226 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -12327,7 +12329,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 12330 "configure" -+#line 12332 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -16737,9 +16739,58 @@ fi - - # Generate manpages, if possible. - build_man=false -+build_doc=false - if test $cross_compiling = no; then -+ for ac_prog in help2man -+do -+ # Extract the first word of "$ac_prog", so it can be a program name with args. -+set dummy $ac_prog; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_HELP2MAN+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$HELP2MAN"; then -+ ac_cv_prog_HELP2MAN="$HELP2MAN" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_prog_HELP2MAN="$ac_prog" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+HELP2MAN=$ac_cv_prog_HELP2MAN -+if test -n "$HELP2MAN"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HELP2MAN" >&5 -+$as_echo "$HELP2MAN" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi - --HELP2MAN=${HELP2MAN-"${am_missing_run}help2man"} -+ -+ test -n "$HELP2MAN" && break -+done -+test -n "$HELP2MAN" || HELP2MAN="$MISSING help2man" -+ -+ case "x$HELP2MAN" in -+ x | */missing\ help2man* ) -+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: gprofng: help2man is missing. Man pages will not be built." >&5 -+$as_echo "$as_me: WARNING: gprofng: help2man is missing. Man pages will not be built." >&2;} -+ ;; -+ * ) build_man=true ;; -+ esac - - for ac_prog in makeinfo - do -@@ -16782,10 +16833,10 @@ fi - - test -n "$MAKEINFO" && break - done --test -n "$MAKEINFO" || MAKEINFO=""@echo makeinfo missing; true"" -+test -n "$MAKEINFO" || MAKEINFO="$MISSING makeinfo" - -- case "$MAKEINFO" in -- *true) -+ case "x$MAKEINFO" in -+ x | */missing\ makeinfo*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: gprofng: makeinfo is missing. Info documentation will not be built." >&5 - $as_echo "$as_me: WARNING: gprofng: makeinfo is missing. Info documentation will not be built." >&2;} - ;; -@@ -16796,9 +16847,7 @@ $as_echo "$as_me: WARNING: gprofng: make - $as_echo "$as_me: WARNING: gprofng: $MAKEINFO is too old. Info documentation will not be built." >&2;} - MAKEINFO="@echo $MAKEINFO is too old, 6.5 or newer required; true" - ;; -- x* ) -- build_man=true -- ;; -+ x* ) build_doc=true ;; - esac - ;; - esac -@@ -16812,6 +16861,14 @@ else - BUILD_MAN_FALSE= - fi - -+ if test x$build_doc = xtrue; then -+ BUILD_DOC_TRUE= -+ BUILD_DOC_FALSE='#' -+else -+ BUILD_DOC_TRUE='#' -+ BUILD_DOC_FALSE= -+fi -+ - - LD_NO_AS_NEEDED=${no_as_needed} - -@@ -17070,6 +17127,10 @@ if test -z "${BUILD_MAN_TRUE}" && test - - as_fn_error $? "conditional \"BUILD_MAN\" was never defined. - Usually this means the macro was only invoked conditionally." "$LINENO" 5 - fi -+if test -z "${BUILD_DOC_TRUE}" && test -z "${BUILD_DOC_FALSE}"; then -+ as_fn_error $? "conditional \"BUILD_DOC\" was never defined. -+Usually this means the macro was only invoked conditionally." "$LINENO" 5 -+fi - - : "${CONFIG_STATUS=./config.status}" - ac_write_fail=0 ---- a/gprofng/configure.ac -+++ b/gprofng/configure.ac -@@ -210,11 +210,19 @@ AM_ZLIB - - # Generate manpages, if possible. - build_man=false -+build_doc=false - if test $cross_compiling = no; then -- AM_MISSING_PROG(HELP2MAN, help2man) -- AC_CHECK_PROGS([MAKEINFO], makeinfo, ["@echo makeinfo missing; true"]) -- case "$MAKEINFO" in -- *true) -+ AC_CHECK_PROGS([HELP2MAN], help2man, [$MISSING help2man]) -+ case "x$HELP2MAN" in -+ x | */missing\ help2man* ) -+ AC_MSG_WARN([gprofng: help2man is missing. Man pages will not be built.]) -+ ;; -+ * ) build_man=true ;; -+ esac -+ -+ AC_CHECK_PROGS([MAKEINFO], makeinfo, [$MISSING makeinfo]) -+ case "x$MAKEINFO" in -+ x | */missing\ makeinfo*) - AC_MSG_WARN([gprofng: makeinfo is missing. Info documentation will not be built.]) - ;; - *) -@@ -223,15 +231,14 @@ if test $cross_compiling = no; then - AC_MSG_WARN([gprofng: $MAKEINFO is too old. Info documentation will not be built.]) - MAKEINFO="@echo $MAKEINFO is too old, 6.5 or newer required; true" - ;; -- x* ) -- build_man=true -- ;; -+ x* ) build_doc=true ;; - esac - ;; - esac - AC_SUBST(MAKEINFO) - fi - AM_CONDITIONAL([BUILD_MAN], [test x$build_man = xtrue]) -+AM_CONDITIONAL([BUILD_DOC], [test x$build_doc = xtrue]) - - AC_SUBST(LD_NO_AS_NEEDED, [${no_as_needed}]) - AC_SUBST(GPROFNG_CFLAGS, [${gprofng_cflags}]) ---- a/gprofng/doc/Makefile.am -+++ b/gprofng/doc/Makefile.am -@@ -19,9 +19,31 @@ - - AUTOMAKE_OPTIONS = info-in-builddir foreign no-texinfo.tex - -+# Options to extract the man page -+MANCONF = -Dman -+ -+TEXI2POD = perl $(srcdir)/../../etc/texi2pod.pl $(AM_MAKEINFOFLAGS) -+POD2MAN = pod2man --center="User Commands" \ -+ --release="binutils-$(VERSION)" --section=1 -+ - info_TEXINFOS = gprofng.texi - gprofng_TEXINFOS = fdl.texi - TEXINFO_TEX = . - MAKEINFOHTML = $(MAKEINFO) --html --no-split - --MAINTAINERCLEANFILES = gprofng.info -+man_MANS = gprofng.1 -+ -+# Build the man page from the texinfo file -+# The sed command removes the no-adjust Nroff command so that -+# the man output looks standard. -+gprofng.1: $(srcdir)/gprofng.texi -+ $(AM_V_GEN)touch $@ -+ $(AM_V_at)-$(TEXI2POD) $(MANCONF) < $(srcdir)/gprofng.texi > gprofng.pod -+ $(AM_V_at)-($(POD2MAN) gprofng.pod | \ -+ sed -e '/^.if n .na/d' > $@.tmp && \ -+ mv -f $@.tmp $@) || (rm -f $@.tmp && exit 1) -+ $(AM_V_at)rm -f gprofng.pod -+ -+MAINTAINERCLEANFILES = gprofng.info $(man_MANS) -+ -+info: $(man_MANS) ---- a/gprofng/doc/Makefile.in -+++ b/gprofng/doc/Makefile.in -@@ -182,7 +182,7 @@ am__can_run_installinfo = \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac --am__installdirs = "$(DESTDIR)$(infodir)" -+am__installdirs = "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)" - am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; - am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ -@@ -210,6 +210,9 @@ am__uninstall_files_from_dir = { \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -+man1dir = $(mandir)/man1 -+NROFF = nroff -+MANS = $(man_MANS) - am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) - am__DIST_COMMON = $(gprofng_TEXINFOS) $(srcdir)/Makefile.in \ - $(top_srcdir)/../mkinstalldirs mdate-sh texinfo.tex -@@ -361,11 +364,19 @@ top_srcdir = @top_srcdir@ - zlibdir = @zlibdir@ - zlibinc = @zlibinc@ - AUTOMAKE_OPTIONS = info-in-builddir foreign no-texinfo.tex -+ -+# Options to extract the man page -+MANCONF = -Dman -+TEXI2POD = perl $(srcdir)/../../etc/texi2pod.pl $(AM_MAKEINFOFLAGS) -+POD2MAN = pod2man --center="User Commands" \ -+ --release="binutils-$(VERSION)" --section=1 -+ - info_TEXINFOS = gprofng.texi - gprofng_TEXINFOS = fdl.texi - TEXINFO_TEX = . - MAKEINFOHTML = $(MAKEINFO) --html --no-split --MAINTAINERCLEANFILES = gprofng.info -+man_MANS = gprofng.1 -+MAINTAINERCLEANFILES = gprofng.info $(man_MANS) - all: all-am - - .SUFFIXES: -@@ -558,6 +569,49 @@ maintainer-clean-aminfo: - echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ - rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ - done -+install-man1: $(man_MANS) -+ @$(NORMAL_INSTALL) -+ @list1=''; \ -+ list2='$(man_MANS)'; \ -+ test -n "$(man1dir)" \ -+ && test -n "`echo $$list1$$list2`" \ -+ || exit 0; \ -+ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ -+ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ -+ { for i in $$list1; do echo "$$i"; done; \ -+ if test -n "$$list2"; then \ -+ for i in $$list2; do echo "$$i"; done \ -+ | sed -n '/\.1[a-z]*$$/p'; \ -+ fi; \ -+ } | while read p; do \ -+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ -+ echo "$$d$$p"; echo "$$p"; \ -+ done | \ -+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ -+ sed 'N;N;s,\n, ,g' | { \ -+ list=; while read file base inst; do \ -+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ -+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ -+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ -+ fi; \ -+ done; \ -+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ -+ while read files; do \ -+ test -z "$$files" || { \ -+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ -+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ -+ done; } -+ -+uninstall-man1: -+ @$(NORMAL_UNINSTALL) -+ @list=''; test -n "$(man1dir)" || exit 0; \ -+ files=`{ for i in $$list; do echo "$$i"; done; \ -+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ -+ sed -n '/\.1[a-z]*$$/p'; \ -+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ -+ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) - tags TAGS: - - ctags CTAGS: -@@ -600,9 +654,9 @@ distdir: $(DISTFILES) - dist-info - check-am: all-am - check: check-am --all-am: Makefile $(INFO_DEPS) -+all-am: Makefile $(INFO_DEPS) $(MANS) - installdirs: -- for dir in "$(DESTDIR)$(infodir)"; do \ -+ for dir in "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done - install: install-am -@@ -652,11 +706,9 @@ html: html-am - - html-am: $(HTMLS) - --info: info-am -- - info-am: $(INFO_DEPS) - --install-data-am: install-info-am -+install-data-am: install-info-am install-man - - install-dvi: install-dvi-am - -@@ -739,7 +791,7 @@ install-info-am: $(INFO_DEPS) - install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ - done; \ - else : ; fi --install-man: -+install-man: install-man1 - - install-pdf: install-pdf-am - -@@ -794,7 +846,9 @@ ps: ps-am - ps-am: $(PSS) - - uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \ -- uninstall-pdf-am uninstall-ps-am -+ uninstall-man uninstall-pdf-am uninstall-ps-am -+ -+uninstall-man: uninstall-man1 - - .MAKE: install-am install-strip - -@@ -804,19 +858,32 @@ uninstall-am: uninstall-dvi-am uninstall - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ -- install-info-am install-man install-pdf install-pdf-am \ -- install-ps install-ps-am install-strip installcheck \ -- installcheck-am installdirs maintainer-clean \ -+ install-info-am install-man install-man1 install-pdf \ -+ install-pdf-am install-ps install-ps-am install-strip \ -+ installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-aminfo maintainer-clean-generic \ - maintainer-clean-vti mostlyclean mostlyclean-aminfo \ - mostlyclean-generic mostlyclean-libtool mostlyclean-vti pdf \ - pdf-am ps ps-am tags-am uninstall uninstall-am \ - uninstall-dvi-am uninstall-html-am uninstall-info-am \ -- uninstall-pdf-am uninstall-ps-am -+ uninstall-man uninstall-man1 uninstall-pdf-am uninstall-ps-am - - .PRECIOUS: Makefile - - -+# Build the man page from the texinfo file -+# The sed command removes the no-adjust Nroff command so that -+# the man output looks standard. -+gprofng.1: $(srcdir)/gprofng.texi -+ $(AM_V_GEN)touch $@ -+ $(AM_V_at)-$(TEXI2POD) $(MANCONF) < $(srcdir)/gprofng.texi > gprofng.pod -+ $(AM_V_at)-($(POD2MAN) gprofng.pod | \ -+ sed -e '/^.if n .na/d' > $@.tmp && \ -+ mv -f $@.tmp $@) || (rm -f $@.tmp && exit 1) -+ $(AM_V_at)rm -f gprofng.pod -+ -+info: $(man_MANS) -+ - # Tell versions [3.59,3.63) of GNU make to not export all variables. - # Otherwise a system limit (for SysV at least) may be exceeded. - .NOEXPORT: ---- a/gprofng/doc/gprofng.texi -+++ b/gprofng/doc/gprofng.texi -@@ -1,5 +1,8 @@ - \input texinfo @c -*-texinfo-*- - -+@c for $sect (qw(NAME SYNOPSIS TARGET DESCRIPTION OPTIONS ENVIRONMENT FILES -+@c BUGS NOTES FOOTNOTES SEEALSO AUTHOR COPYRIGHT)) { -+ - @c ---------------------------------------------------------------------------- - @c This is the Texinfo source file for the GPROFNG manual. - @c -@@ -59,6 +62,10 @@ gprofng - @cindex \label\, \string\ - @end macro - -+@macro gcctabopt{body} -+@code{\body\} -+@end macro -+ - @c -- Get the version information --------------------------------------------- - @include version.texi - -@@ -99,6 +106,20 @@ section entitled ``GNU Free Documentatio - @page - @vskip 0pt plus 1filll - @insertcopying -+ -+@c man begin COPYRIGHT -+ -+Copyright @copyright{} 2022-2023 Free Software Foundation, Inc. -+ -+Permission is granted to copy, distribute and/or modify this document -+under the terms of the GNU Free Documentation License, Version 1.3 -+or any later version published by the Free Software Foundation; -+with no Invariant Sections, with no Front-Cover Texts, and with no -+Back-Cover Texts. A copy of the license is included in the -+section entitled ``GNU Free Documentation License''. -+ -+@c man end -+ - @end titlepage - - @c -- Generate the Table of Contents ------------------------------------------ -@@ -163,6 +184,154 @@ Terminology - @end menu - @end ifinfo - -+@ifset man -+ -+@c man title gprofng the driver for the gprofng tool suite -+ -+@c man begin SYNOPSIS -+gprofng [OPTION(S)] ACTION [@b{QUALIFIER}] [ARGUMENTS] TARGET -+@c man end -+ -+@c man begin DESCRIPTION -+This is the driver for the GPROFNG tools suite to gather and analyze performance data. -+ -+The driver executes the action specified. An example of an action is @code{collect} -+to collect performance data. Depending on the action, a qualifier may be needed to -+define the command. Several qualifiers support options. The last item on the command -+is the target the command applies to. -+ -+For example, to collect performance data for an application called @code{a.out} and -+store the results in experiment directory @code{mydata.er}, the following command may -+be used: -+ -+@smallexample -+$ gprofng collect app -o mydata.er a.out -+@end smallexample -+ -+In this example, the action is @code{collect}, the qualifier is @code{app}, the single -+argument is @code{-o mydata.er} and the target is @code{a.out}. -+ -+If gprofng is executed without any additional option, action, or target, a usage -+overview is printed. -+ -+@c man end -+ -+@c man begin OPTIONS -+ -+@table @gcctabopt -+ -+@item @var{--version} -+print the version number and exit. -+ -+@item @var{--help} -+print usage information and exit. -+ -+@end table -+ -+@c man end -+ -+@c man begin NOTES -+ -+The gprofng driver supports the following commands. -+ -+@c The man pages for the commands below can be viewed using the command name with "gprofng" replaced by "gp" and the spaces replaced by a dash ("-"). For example the man page -+@c name for "gprofng collect app" is "gp-collect-app". -+ -+Collect performance data: -+ -+@table @code -+ -+@item gprofng collect app -+collect application performance data. -+ -+@end table -+ -+Display the performance results: -+ -+@table @code -+ -+@item gprofng display text -+display the performance data in ASCII format. -+ -+@item gprofng display html -+generate an HTML file from one or more experiments. -+ -+@end table -+ -+Miscellaneous commands: -+ -+@table @code -+ -+@item gprofng display src -+display source or disassembly with compiler annotations. -+ -+@item gprofng archive -+include binaries and source code in an experiment directory. -+ -+@end table -+ -+It is also possible to invoke the lower level commands directly, but since -+these are subject to change, in particular the options, we recommend to -+use the driver. -+ -+@c man end -+ -+@c man begin ENVIRONMENT -+The following environment variables are supported: -+ -+@table @code -+ -+@item @env{GPROFNG_MAX_CALL_STACK_DEPTH} -+set the depth of the call stack (default is 256). -+ -+@item @env{GPROFNG_USE_JAVA_OPTIONS} -+may be set when profiling a C/C++ application that uses dlopen() to execute Java code. -+ -+@item @env{GPROFNG_SSH_REMOTE_DISPLAY} -+use this variable to define the ssh command executed by the remote display tool. -+ -+@item @env{GPROFNG_SKIP_VALIDATION} -+set this variable to disable checking hardware, system, and Java versions. -+ -+@item @env{GPROFNG_ALLOW_CORE_DUMP} -+set this variable to allow a core file to be generated; otherwise an error report is created on /tmp. -+ -+@item @env{GPROFNG_ARCHIVE} -+use this variable to define the settings for automatic archiving upon experiment recording completion. -+ -+@item @env{GPROFNG_ARCHIVE_COMMON_DIR} -+set this variable to the location of the common archive. -+ -+@item @env{GPROFNG_JAVA_MAX_CALL_STACK_DEPTH} -+set the depth of the Java call stack; the default is 256; set to 0 to disable capturing of call stacks. -+ -+@item @env{GPROFNG_JAVA_NATIVE_MAX_CALL_STACK_DEPTH} -+set the depth of the Java native call stack; the default is 256; set to 0 to disable capturing of call stacks (JNI and assembly call stacks are not captured). -+ -+@end table -+ -+@c man end -+ -+@c man begin SEEALSO -+The man pages for the various gprofng commands are not available yet, but -+the @option{--help} option supported on each of the commands lists the options -+and provides more information. -+ -+For example this displays the options supported on the @command{gprofng collect app} -+command: -+ -+@smallexample -+$ gprofng collect app --help -+@end smallexample -+ -+The user guide is available as an Info entry for @file{gprofng}. -+@c man end -+ -+@end ifset -+ -+@c man begin DESCRIPTION -+@c man end -+ - @c -- A new node -------------------------------------------------------------- - @node Introduction - @chapter Introduction ---- a/gprofng/src/Makefile.am -+++ b/gprofng/src/Makefile.am -@@ -160,7 +160,7 @@ gp_display_text_LDADD = $(LIBGPROFNG) $( - - if BUILD_MAN - --man_MANS = gprofng.1 \ -+man_MANS = \ - gp-archive.1 \ - gp-collect-app.1 \ - gp-display-src.1 \ -@@ -191,10 +191,6 @@ H2M_FILTER = | sed 's/\.TP/\.TP\n.B/' | - | sed 's/See also:/\.SH SEE ALSO/' | sed 's/Documentation:/.SH DOCUMENTATION/' \ - | sed 's/Limitations:/.SH LIMITATIONS/' - --gprofng.1: $(srcdir)/gprofng.cc $(common_mandeps) | ./gprofng$(EXEEXT) -- $(AM_V_GEN)_BUILDING_MANPAGE=1 $(HELP2MAN) $(HELP2MAN_OPT) \ -- --name=$(TEXT_GPROFNG) ./gprofng$(EXEEXT) $(H2M_FILTER) > $@ -- - gp-archive.1: $(srcdir)/gp-archive.cc $(common_mandeps) | ./gp-archive$(EXEEXT) - $(AM_V_GEN)_BUILDING_MANPAGE=1 $(HELP2MAN) $(HELP2MAN_OPT) \ - --name=$(TEXT_GP_ARCHIVE) ./gp-archive$(EXEEXT) $(H2M_FILTER) > $@ -@@ -223,3 +219,5 @@ dist-hook: $(LIBGPROFNG) - - install-data-local: install-pkglibLTLIBRARIES - rm -f $(DESTDIR)/$(pkglibdir)/*.la $(DESTDIR)/$(pkglibdir)/*.a -+ -+$(srcdir)/DbeSession.cc: QLParser.tab.hh ---- a/gprofng/src/Makefile.in -+++ b/gprofng/src/Makefile.in -@@ -572,7 +572,7 @@ gp_display_src_SOURCES = gp-display-src. - gp_display_src_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB) - gp_display_text_SOURCES = gp-display-text.cc ipc.cc ipcio.cc - gp_display_text_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB) --@BUILD_MAN_TRUE@man_MANS = gprofng.1 \ -+@BUILD_MAN_TRUE@man_MANS = \ - @BUILD_MAN_TRUE@ gp-archive.1 \ - @BUILD_MAN_TRUE@ gp-collect-app.1 \ - @BUILD_MAN_TRUE@ gp-display-src.1 \ -@@ -1176,10 +1176,6 @@ uninstall-man: uninstall-man1 - QLParser.tab.cc QLParser.tab.hh: QLParser.yy - $(BISON) $^ - --@BUILD_MAN_TRUE@gprofng.1: $(srcdir)/gprofng.cc $(common_mandeps) | ./gprofng$(EXEEXT) --@BUILD_MAN_TRUE@ $(AM_V_GEN)_BUILDING_MANPAGE=1 $(HELP2MAN) $(HELP2MAN_OPT) \ --@BUILD_MAN_TRUE@ --name=$(TEXT_GPROFNG) ./gprofng$(EXEEXT) $(H2M_FILTER) > $@ -- - @BUILD_MAN_TRUE@gp-archive.1: $(srcdir)/gp-archive.cc $(common_mandeps) | ./gp-archive$(EXEEXT) - @BUILD_MAN_TRUE@ $(AM_V_GEN)_BUILDING_MANPAGE=1 $(HELP2MAN) $(HELP2MAN_OPT) \ - @BUILD_MAN_TRUE@ --name=$(TEXT_GP_ARCHIVE) ./gp-archive$(EXEEXT) $(H2M_FILTER) > $@ -@@ -1207,6 +1203,8 @@ dist-hook: $(LIBGPROFNG) - install-data-local: install-pkglibLTLIBRARIES - rm -f $(DESTDIR)/$(pkglibdir)/*.la $(DESTDIR)/$(pkglibdir)/*.a - -+$(srcdir)/DbeSession.cc: QLParser.tab.hh -+ - # Tell versions [3.59,3.63) of GNU make to not export all variables. - # Otherwise a system limit (for SysV at least) may be exceeded. - .NOEXPORT: diff --git a/toolchain/binutils/patches/2.40/020-gprofng-PR30043-libgprofng.so.-are-installed-to-a-wr.patch b/toolchain/binutils/patches/2.40/020-gprofng-PR30043-libgprofng.so.-are-installed-to-a-wr.patch deleted file mode 100644 index d8d76a2961..0000000000 --- a/toolchain/binutils/patches/2.40/020-gprofng-PR30043-libgprofng.so.-are-installed-to-a-wr.patch +++ /dev/null @@ -1,212 +0,0 @@ -From edd36b26f3506eeb259534ba2493e15c728cd280 Mon Sep 17 00:00:00 2001 -From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com> -Date: Wed, 25 Jan 2023 19:21:38 -0800 -Subject: [PATCH 20/50] gprofng: PR30043 libgprofng.so.* are installed to a - wrong location - -gprofng/ChangeLog -2023-01-25 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> - - PR gprofng/30043 - PR gprofng/28972 - * src/Makefile.am: Use lib_LTLIBRARIES instead of pkglib_LTLIBRARIES. - * src/Makefile.in: Rebuild. ---- - gprofng/src/Makefile.am | 7 +--- - gprofng/src/Makefile.in | 76 +++++++++++++++++++---------------------- - 2 files changed, 37 insertions(+), 46 deletions(-) - ---- a/gprofng/src/Makefile.am -+++ b/gprofng/src/Makefile.am -@@ -124,7 +124,7 @@ BUILT_SOURCES = QLParser.tab.hh - EXTRA_DIST = QLParser.yy $(man_MANS) - - --pkglib_LTLIBRARIES = $(LIBGPROFNG) -+lib_LTLIBRARIES = $(LIBGPROFNG) - libgprofng_la_SOURCES = $(CCSOURCES) $(CSOURCES) - libgprofng_la_LDFLAGS = -version-info 0:0:0 - -@@ -215,9 +215,4 @@ endif - # so ensure that the necessary libraries are built at dist time. - dist-hook: $(LIBGPROFNG) - --.PHONY: install-data-local -- --install-data-local: install-pkglibLTLIBRARIES -- rm -f $(DESTDIR)/$(pkglibdir)/*.la $(DESTDIR)/$(pkglibdir)/*.a -- - $(srcdir)/DbeSession.cc: QLParser.tab.hh ---- a/gprofng/src/Makefile.in -+++ b/gprofng/src/Makefile.in -@@ -155,9 +155,9 @@ am__uninstall_files_from_dir = { \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } --am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(bindir)" \ -+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ - "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(dbedir)" --LTLIBRARIES = $(pkglib_LTLIBRARIES) -+LTLIBRARIES = $(lib_LTLIBRARIES) - am__DEPENDENCIES_1 = - libgprofng_la_DEPENDENCIES = $(top_builddir)/../opcodes/libopcodes.la \ - $(top_builddir)/../bfd/libbfd.la $(am__DEPENDENCIES_1) -@@ -548,7 +548,7 @@ AM_CFLAGS = $(GPROFNG_CFLAGS) $(PTHREAD_ - AM_CXXFLAGS = $(AM_CFLAGS) - BUILT_SOURCES = QLParser.tab.hh - EXTRA_DIST = QLParser.yy $(man_MANS) --pkglib_LTLIBRARIES = $(LIBGPROFNG) -+lib_LTLIBRARIES = $(LIBGPROFNG) - libgprofng_la_SOURCES = $(CCSOURCES) $(CSOURCES) - libgprofng_la_LDFLAGS = -version-info 0:0:0 - -@@ -636,33 +636,33 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $( - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - $(am__aclocal_m4_deps): - --install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) -+install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) -- @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ -+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ -- echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \ -- $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \ -- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ -- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ -+ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ -+ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ -+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ -+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ - } - --uninstall-pkglibLTLIBRARIES: -+uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) -- @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ -+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ -- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ -- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ -+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ -+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ - done - --clean-pkglibLTLIBRARIES: -- -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) -- @list='$(pkglib_LTLIBRARIES)'; \ -+clean-libLTLIBRARIES: -+ -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) -+ @list='$(lib_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ -@@ -672,7 +672,7 @@ clean-pkglibLTLIBRARIES: - } - - libgprofng.la: $(libgprofng_la_OBJECTS) $(libgprofng_la_DEPENDENCIES) $(EXTRA_libgprofng_la_DEPENDENCIES) -- $(AM_V_CXXLD)$(libgprofng_la_LINK) -rpath $(pkglibdir) $(libgprofng_la_OBJECTS) $(libgprofng_la_LIBADD) $(LIBS) -+ $(AM_V_CXXLD)$(libgprofng_la_LINK) -rpath $(libdir) $(libgprofng_la_OBJECTS) $(libgprofng_la_LIBADD) $(LIBS) - install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ -@@ -1039,8 +1039,10 @@ check-am: all-am - check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-am - all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(MANS) $(DATA) -+install-binPROGRAMS: install-libLTLIBRARIES -+ - installdirs: -- for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(dbedir)"; do \ -+ for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(dbedir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done - install: $(BUILT_SOURCES) -@@ -1078,8 +1080,8 @@ maintainer-clean-generic: - -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) - clean: clean-am - --clean-am: clean-binPROGRAMS clean-generic clean-libtool \ -- clean-pkglibLTLIBRARIES mostlyclean-am -+clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ -+ clean-libtool mostlyclean-am - - distclean: distclean-am - -rm -rf ./$(DEPDIR) -@@ -1099,13 +1101,13 @@ info: info-am - - info-am: - --install-data-am: install-data-local install-dbeDATA install-man -+install-data-am: install-dbeDATA install-man - - install-dvi: install-dvi-am - - install-dvi-am: - --install-exec-am: install-binPROGRAMS install-pkglibLTLIBRARIES -+install-exec-am: install-binPROGRAMS install-libLTLIBRARIES - - install-html: install-html-am - -@@ -1145,30 +1147,29 @@ ps: ps-am - - ps-am: - --uninstall-am: uninstall-binPROGRAMS uninstall-dbeDATA uninstall-man \ -- uninstall-pkglibLTLIBRARIES -+uninstall-am: uninstall-binPROGRAMS uninstall-dbeDATA \ -+ uninstall-libLTLIBRARIES uninstall-man - - uninstall-man: uninstall-man1 - - .MAKE: all check install install-am install-strip - - .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ -- clean-binPROGRAMS clean-generic clean-libtool \ -- clean-pkglibLTLIBRARIES cscopelist-am ctags ctags-am dist-hook \ -- distclean distclean-compile distclean-generic \ -- distclean-libtool distclean-tags distdir dvi dvi-am html \ -- html-am info info-am install install-am install-binPROGRAMS \ -- install-data install-data-am install-data-local \ -- install-dbeDATA install-dvi install-dvi-am install-exec \ -- install-exec-am install-html install-html-am install-info \ -- install-info-am install-man install-man1 install-pdf \ -- install-pdf-am install-pkglibLTLIBRARIES install-ps \ -+ clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ -+ clean-libtool cscopelist-am ctags ctags-am dist-hook distclean \ -+ distclean-compile distclean-generic distclean-libtool \ -+ distclean-tags distdir dvi dvi-am html html-am info info-am \ -+ install install-am install-binPROGRAMS install-data \ -+ install-data-am install-dbeDATA install-dvi install-dvi-am \ -+ install-exec install-exec-am install-html install-html-am \ -+ install-info install-info-am install-libLTLIBRARIES \ -+ install-man install-man1 install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am uninstall-binPROGRAMS uninstall-dbeDATA \ -- uninstall-man uninstall-man1 uninstall-pkglibLTLIBRARIES -+ uninstall-libLTLIBRARIES uninstall-man uninstall-man1 - - .PRECIOUS: Makefile - -@@ -1198,11 +1199,6 @@ QLParser.tab.cc QLParser.tab.hh: QLParse - # so ensure that the necessary libraries are built at dist time. - dist-hook: $(LIBGPROFNG) - --.PHONY: install-data-local -- --install-data-local: install-pkglibLTLIBRARIES -- rm -f $(DESTDIR)/$(pkglibdir)/*.la $(DESTDIR)/$(pkglibdir)/*.a -- - $(srcdir)/DbeSession.cc: QLParser.tab.hh - - # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/toolchain/binutils/patches/2.40/026-RISC-V-make-C-extension-JAL-available-again-for-32-b.patch b/toolchain/binutils/patches/2.40/026-RISC-V-make-C-extension-JAL-available-again-for-32-b.patch deleted file mode 100644 index 4129a22906..0000000000 --- a/toolchain/binutils/patches/2.40/026-RISC-V-make-C-extension-JAL-available-again-for-32-b.patch +++ /dev/null @@ -1,115 +0,0 @@ -From 27f59ec47a18277b6ea3548f405263ef558f5217 Mon Sep 17 00:00:00 2001 -From: Jan Beulich <jbeulich@suse.com> -Date: Tue, 31 Jan 2023 09:47:22 +0100 -Subject: [PATCH 26/50] RISC-V: make C-extension JAL available again for - (32-bit) assembly - -Along with the normal JAL alias, the C-extension one should have been -moved as well by 839189bc932e ("RISC-V: re-arrange opcode table for -consistent alias handling"), for the assembler to actually be able to -use it where/when possible. - -Since neither this nor any other compressed branch insn was being tested -so far, take the opportunity and introduce a new testcase covering those. ---- - gas/config/tc-riscv.c | 3 +++ - gas/testsuite/gas/riscv/c-branch-na.d | 20 ++++++++++++++++++++ - gas/testsuite/gas/riscv/c-branch.d | 19 +++++++++++++++++++ - gas/testsuite/gas/riscv/c-branch.s | 11 +++++++++++ - opcodes/riscv-opc.c | 2 +- - 5 files changed, 54 insertions(+), 1 deletion(-) - create mode 100644 gas/testsuite/gas/riscv/c-branch-na.d - create mode 100644 gas/testsuite/gas/riscv/c-branch.d - create mode 100644 gas/testsuite/gas/riscv/c-branch.s - ---- a/gas/config/tc-riscv.c -+++ b/gas/config/tc-riscv.c -@@ -2762,6 +2762,8 @@ riscv_ip (char *str, struct riscv_cl_ins - case 'p': - goto branch; - case 'a': -+ if (oparg == insn->args + 1) -+ goto jump_check_gpr; - goto jump; - case 'S': /* Floating-point RS1 x8-x15. */ - if (!reg_lookup (&asarg, RCLASS_FPR, ®no) -@@ -3271,6 +3273,7 @@ riscv_ip (char *str, struct riscv_cl_ins - but the 2nd (with 2 operands) might. */ - if (oparg == insn->args) - { -+ jump_check_gpr: - asargStart = asarg; - if (reg_lookup (&asarg, RCLASS_GPR, NULL) - && (*asarg == ',' || (ISSPACE (*asarg) && asarg[1] == ','))) ---- /dev/null -+++ b/gas/testsuite/gas/riscv/c-branch-na.d -@@ -0,0 +1,20 @@ -+#as: -march=rv32ic -+#source: c-branch.s -+#objdump: -drw -Mno-aliases -+ -+.*:[ ]+file format .* -+ -+ -+Disassembly of section .text: -+ -+0+ <target>: -+[ ]+[0-9a-f]+:[ ]+c001[ ]+c\.beqz[ ]+s0,0 <target>[ ]+0: R_RISCV_RVC_BRANCH .* -+[ ]+[0-9a-f]+:[ ]+dcfd[ ]+c\.beqz[ ]+s1,0 <target>[ ]+2: R_RISCV_RVC_BRANCH .* -+[ ]+[0-9a-f]+:[ ]+fc75[ ]+c\.bnez[ ]+s0,0 <target>[ ]+4: R_RISCV_RVC_BRANCH .* -+[ ]+[0-9a-f]+:[ ]+fced[ ]+c\.bnez[ ]+s1,0 <target>[ ]+6: R_RISCV_RVC_BRANCH .* -+[ ]+[0-9a-f]+:[ ]+bfe5[ ]+c\.j[ ]+0 <target>[ ]+8: R_RISCV_RVC_JUMP .* -+[ ]+[0-9a-f]+:[ ]+3fdd[ ]+c\.jal[ ]+0 <target>[ ]+a: R_RISCV_RVC_JUMP .* -+[ ]+[0-9a-f]+:[ ]+9302[ ]+c\.jalr[ ]+t1 -+[ ]+[0-9a-f]+:[ ]+8382[ ]+c\.jr[ ]+t2 -+[ ]+[0-9a-f]+:[ ]+8082[ ]+c\.jr[ ]+ra -+#... ---- /dev/null -+++ b/gas/testsuite/gas/riscv/c-branch.d -@@ -0,0 +1,19 @@ -+#as: -march=rv64ic -+#objdump: -drw -+ -+.*:[ ]+file format .* -+ -+ -+Disassembly of section .text: -+ -+0+ <target>: -+[ ]+[0-9a-f]+:[ ]+c001[ ]+beqz[ ]+s0,0 <target>[ ]+0: R_RISCV_RVC_BRANCH .* -+[ ]+[0-9a-f]+:[ ]+dcfd[ ]+beqz[ ]+s1,0 <target>[ ]+2: R_RISCV_RVC_BRANCH .* -+[ ]+[0-9a-f]+:[ ]+fc75[ ]+bnez[ ]+s0,0 <target>[ ]+4: R_RISCV_RVC_BRANCH .* -+[ ]+[0-9a-f]+:[ ]+fced[ ]+bnez[ ]+s1,0 <target>[ ]+6: R_RISCV_RVC_BRANCH .* -+[ ]+[0-9a-f]+:[ ]+bfe5[ ]+j[ ]+0 <target>[ ]+8: R_RISCV_RVC_JUMP .* -+[ ]+[0-9a-f]+:[ ]+ff7ff0ef[ ]+jal[ ]+0 <target>[ ]+a: R_RISCV_JAL .* -+[ ]+[0-9a-f]+:[ ]+9302[ ]+jalr[ ]+t1 -+[ ]+[0-9a-f]+:[ ]+8382[ ]+jr[ ]+t2 -+[ ]+[0-9a-f]+:[ ]+8082[ ]+ret -+#... ---- /dev/null -+++ b/gas/testsuite/gas/riscv/c-branch.s -@@ -0,0 +1,11 @@ -+ .text -+target: -+ beq x8, x0, target -+ beqz x9, target -+ bne x8, x0, target -+ bnez x9, target -+ j target -+ jal target -+ jalr x6 -+ jr x7 -+ ret ---- a/opcodes/riscv-opc.c -+++ b/opcodes/riscv-opc.c -@@ -340,9 +340,9 @@ const struct riscv_opcode riscv_opcodes[ - {"jalr", 0, INSN_CLASS_I, "d,s,j", MATCH_JALR, MASK_JALR, match_opcode, INSN_JSR }, - {"j", 0, INSN_CLASS_C, "Ca", MATCH_C_J, MASK_C_J, match_opcode, INSN_ALIAS|INSN_BRANCH }, - {"j", 0, INSN_CLASS_I, "a", MATCH_JAL, MASK_JAL|MASK_RD, match_opcode, INSN_ALIAS|INSN_BRANCH }, -+{"jal", 32, INSN_CLASS_C, "Ca", MATCH_C_JAL, MASK_C_JAL, match_opcode, INSN_ALIAS|INSN_JSR }, - {"jal", 0, INSN_CLASS_I, "a", MATCH_JAL|(X_RA << OP_SH_RD), MASK_JAL|MASK_RD, match_opcode, INSN_ALIAS|INSN_JSR }, - {"jal", 0, INSN_CLASS_I, "d,a", MATCH_JAL, MASK_JAL, match_opcode, INSN_JSR }, --{"jal", 32, INSN_CLASS_C, "Ca", MATCH_C_JAL, MASK_C_JAL, match_opcode, INSN_ALIAS|INSN_JSR }, - {"call", 0, INSN_CLASS_I, "d,c", (X_T1 << OP_SH_RS1), (int) M_CALL, match_never, INSN_MACRO }, - {"call", 0, INSN_CLASS_I, "c", (X_RA << OP_SH_RS1)|(X_RA << OP_SH_RD), (int) M_CALL, match_never, INSN_MACRO }, - {"tail", 0, INSN_CLASS_I, "c", (X_T1 << OP_SH_RS1), (int) M_CALL, match_never, INSN_MACRO }, diff --git a/toolchain/binutils/patches/2.40/034-bpf-fix-error-conversion-from-long-unsigned-int-to-u.patch b/toolchain/binutils/patches/2.40/034-bpf-fix-error-conversion-from-long-unsigned-int-to-u.patch deleted file mode 100644 index d4317cdb0f..0000000000 --- a/toolchain/binutils/patches/2.40/034-bpf-fix-error-conversion-from-long-unsigned-int-to-u.patch +++ /dev/null @@ -1,209 +0,0 @@ -From 3e888977f165594cf44dbe8f67e3a4960b22c11f Mon Sep 17 00:00:00 2001 -From: "Guillermo E. Martinez" <guillermo.e.martinez@oracle.com> -Date: Fri, 3 Feb 2023 11:17:49 -0600 -Subject: [PATCH 34/50] bpf: fix error conversion from long unsigned int to - unsigned int [-Werror=overflow] -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Regenerating BPF target using the maintainer mode emits: -.../opcodes/bpf-opc.c:57:11: error: conversion from ‘long unsigned int’ to ‘unsigned int’ changes value from ‘18446744073709486335’ to ‘4294902015’ [-Werror=overflow] - 57 | 64, 64, 0xffffffffffff00ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } - -The use of a narrow size to handle the mask CGEN in instruction format -is causing this error. Additionally eBPF `call' instructions -constructed by expressions using symbols (BPF_PSEUDO_CALL) emits -annotations in `src' field of the instruction, used to identify BPF -target endianness. - -cpu/ - * bpf.cpu (define-call-insn): Remove `src' field from - instruction mask. - -include/ - *opcode/cge.h (CGEN_IFMT): Adjust mask bit width. - -opcodes/ - * bpf-opc.c: Regenerate. - -(cherry picked from commit 7f6ebecd56e690012b05af0a492280765b17f186) ---- - cpu/bpf.cpu | 2 +- - include/opcode/cgen.h | 2 +- - opcodes/bpf-opc.c | 54 +++++++++++++++++++++++-------------------- - opcodes/cgen-dis.c | 2 +- - 4 files changed, 32 insertions(+), 28 deletions(-) - ---- a/cpu/bpf.cpu -+++ b/cpu/bpf.cpu -@@ -768,7 +768,7 @@ - "call" - (endian-isas x-endian) - "call $disp32" -- (+ disp32 (f-offset16 0) (f-regs 0) -+ (+ disp32 (f-offset16 0) (.sym src x-endian) ((.sym f-dst x-endian) 0) - OP_CLASS_JMP OP_SRC_K OP_CODE_CALL) - (c-call VOID - "bpfbf_call" disp32 (ifield (.sym f-src x-endian))) ---- a/include/opcode/cgen.h -+++ b/include/opcode/cgen.h -@@ -914,7 +914,7 @@ typedef struct - Each insn's value is stored with the insn. - The first step in recognizing an insn for disassembly is - (opcode & mask) == value. */ -- CGEN_INSN_INT mask; -+ CGEN_INSN_LGUINT mask; - #define CGEN_IFMT_MASK(ifmt) ((ifmt)->mask) - - /* Instruction fields. ---- a/opcodes/bpf-opc.c -+++ b/opcodes/bpf-opc.c -@@ -50,99 +50,103 @@ static const CGEN_IFMT ifmt_empty ATTRIB - }; - - static const CGEN_IFMT ifmt_addile ATTRIBUTE_UNUSED = { -- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } -+ 64, 64, 0xfffff0ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } - }; - - static const CGEN_IFMT ifmt_addrle ATTRIBUTE_UNUSED = { -- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } -+ 64, 64, 0xffffffffffff00ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } - }; - - static const CGEN_IFMT ifmt_negle ATTRIBUTE_UNUSED = { -- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } -+ 64, 64, 0xfffffffffffff0ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } - }; - - static const CGEN_IFMT ifmt_addibe ATTRIBUTE_UNUSED = { -- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } -+ 64, 64, 0xffff0fff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } - }; - - static const CGEN_IFMT ifmt_addrbe ATTRIBUTE_UNUSED = { -- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } -+ 64, 64, 0xffffffffffff00ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } - }; - - static const CGEN_IFMT ifmt_negbe ATTRIBUTE_UNUSED = { -- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } -+ 64, 64, 0xffffffffffff0fff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } - }; - - static const CGEN_IFMT ifmt_endlele ATTRIBUTE_UNUSED = { -- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } -+ 64, 64, 0xfffff0ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } - }; - - static const CGEN_IFMT ifmt_endlebe ATTRIBUTE_UNUSED = { -- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } -+ 64, 64, 0xffff0fff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } - }; - - static const CGEN_IFMT ifmt_lddwle ATTRIBUTE_UNUSED = { -- 64, 128, 0xff, { { F (F_IMM64) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_DSTLE) }, { F (F_OP_CLASS) }, { 0 } } -+ 64, 128, 0xfffff0ff, { { F (F_IMM64) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_DSTLE) }, { F (F_OP_CLASS) }, { 0 } } - }; - - static const CGEN_IFMT ifmt_lddwbe ATTRIBUTE_UNUSED = { -- 64, 128, 0xff, { { F (F_IMM64) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_SRCBE) }, { F (F_OP_CLASS) }, { 0 } } -+ 64, 128, 0xffff0fff, { { F (F_IMM64) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_SRCBE) }, { F (F_OP_CLASS) }, { 0 } } - }; - - static const CGEN_IFMT ifmt_ldabsw ATTRIBUTE_UNUSED = { -- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_REGS) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_OP_CLASS) }, { 0 } } -+ 64, 64, 0xffffffff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_REGS) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_OP_CLASS) }, { 0 } } - }; - - static const CGEN_IFMT ifmt_ldindwle ATTRIBUTE_UNUSED = { -- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_DSTLE) }, { F (F_OP_CLASS) }, { 0 } } -+ 64, 64, 0xffff0fff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_DSTLE) }, { F (F_OP_CLASS) }, { 0 } } - }; - - static const CGEN_IFMT ifmt_ldindwbe ATTRIBUTE_UNUSED = { -- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_SRCBE) }, { F (F_OP_CLASS) }, { 0 } } -+ 64, 64, 0xfffff0ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_SRCBE) }, { F (F_OP_CLASS) }, { 0 } } - }; - - static const CGEN_IFMT ifmt_ldxwle ATTRIBUTE_UNUSED = { -- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_DSTLE) }, { F (F_OP_CLASS) }, { 0 } } -+ 64, 64, 0xffffffff000000ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_DSTLE) }, { F (F_OP_CLASS) }, { 0 } } - }; - - static const CGEN_IFMT ifmt_ldxwbe ATTRIBUTE_UNUSED = { -- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_SRCBE) }, { F (F_OP_CLASS) }, { 0 } } -+ 64, 64, 0xffffffff000000ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_SRCBE) }, { F (F_OP_CLASS) }, { 0 } } - }; - - static const CGEN_IFMT ifmt_stble ATTRIBUTE_UNUSED = { -- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_DSTLE) }, { F (F_OP_CLASS) }, { 0 } } -+ 64, 64, 0xf0ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_DSTLE) }, { F (F_OP_CLASS) }, { 0 } } - }; - - static const CGEN_IFMT ifmt_stbbe ATTRIBUTE_UNUSED = { -- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_SRCBE) }, { F (F_OP_CLASS) }, { 0 } } -+ 64, 64, 0xfff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_SRCBE) }, { F (F_OP_CLASS) }, { 0 } } - }; - - static const CGEN_IFMT ifmt_jeqile ATTRIBUTE_UNUSED = { -- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } -+ 64, 64, 0xf0ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } - }; - - static const CGEN_IFMT ifmt_jeqrle ATTRIBUTE_UNUSED = { -- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } -+ 64, 64, 0xffffffff000000ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } - }; - - static const CGEN_IFMT ifmt_jeqibe ATTRIBUTE_UNUSED = { -- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } -+ 64, 64, 0xfff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } - }; - - static const CGEN_IFMT ifmt_jeqrbe ATTRIBUTE_UNUSED = { -- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } -+ 64, 64, 0xffffffff000000ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } - }; - - static const CGEN_IFMT ifmt_callle ATTRIBUTE_UNUSED = { -- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_REGS) }, { F (F_OP_CODE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } -+ 64, 64, 0xffff0fff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_callbe ATTRIBUTE_UNUSED = { -+ 64, 64, 0xfffff0ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } - }; - - static const CGEN_IFMT ifmt_ja ATTRIBUTE_UNUSED = { -- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_REGS) }, { F (F_OP_CODE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } -+ 64, 64, 0xffffffff0000ffff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_REGS) }, { F (F_OP_CODE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } - }; - - static const CGEN_IFMT ifmt_exit ATTRIBUTE_UNUSED = { -- 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_REGS) }, { F (F_OP_CODE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } -+ 64, 64, 0xffffffffffffffff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_REGS) }, { F (F_OP_CODE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } - }; - - #undef F -@@ -1646,7 +1650,7 @@ static const CGEN_OPCODE bpf_cgen_insn_o - { - { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (DISP32), 0 } }, -- & ifmt_callle, { 0x85 } -+ & ifmt_callbe, { 0x85 } - }, - /* call $dstle */ - { ---- a/opcodes/cgen-dis.c -+++ b/opcodes/cgen-dis.c -@@ -39,7 +39,7 @@ static void add_insn_to_hash_chain (CG - static int - count_decodable_bits (const CGEN_INSN *insn) - { -- unsigned mask = CGEN_INSN_BASE_MASK (insn); -+ CGEN_INSN_LGUINT mask = CGEN_INSN_BASE_MASK (insn); - #if GCC_VERSION >= 3004 - return __builtin_popcount (mask); - #else diff --git a/toolchain/binutils/patches/2.40/035-Pass-JANSSON_LIBS-and-ZSTD_LIBS-to-ld-bootstrap-boot.patch b/toolchain/binutils/patches/2.40/035-Pass-JANSSON_LIBS-and-ZSTD_LIBS-to-ld-bootstrap-boot.patch deleted file mode 100644 index 3741c08a0c..0000000000 --- a/toolchain/binutils/patches/2.40/035-Pass-JANSSON_LIBS-and-ZSTD_LIBS-to-ld-bootstrap-boot.patch +++ /dev/null @@ -1,50 +0,0 @@ -From e1815414077347097e5bf0d75162add955e241d9 Mon Sep 17 00:00:00 2001 -From: Romain Geissler <romain.geissler@amadeus.com> -Date: Sun, 5 Feb 2023 13:56:34 +0000 -Subject: [PATCH 35/50] Pass $JANSSON_LIBS and $ZSTD_LIBS to - ld-bootstrap/bootrap.exp - ---- - ld/Makefile.am | 1 + - ld/Makefile.in | 1 + - ld/testsuite/ld-bootstrap/bootstrap.exp | 4 ++-- - 3 files changed, 4 insertions(+), 2 deletions(-) - ---- a/ld/Makefile.am -+++ b/ld/Makefile.am -@@ -992,6 +992,7 @@ check-DEJAGNU: site.exp - CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ - OFILES="$(OFILES)" BFDLIB="$(TESTBFDLIB)" CTFLIB="$(TESTCTFLIB) $(ZLIB)" \ - SFRAMELIB="$(TESTSFRAMELIB)" \ -+ JANSSON_LIBS="$(JANSSON_LIBS)" ZSTD_LIBS="$(ZSTD_LIBS)" \ - LIBIBERTY="$(LIBIBERTY) $(LIBINTL)" LIBS="$(LIBS)" \ - DO_COMPARE="`echo '$(do_compare)' | sed -e 's,\\$$,,g'`" \ - $(RUNTESTFLAGS); \ ---- a/ld/Makefile.in -+++ b/ld/Makefile.in -@@ -2645,6 +2645,7 @@ check-DEJAGNU: site.exp - CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ - OFILES="$(OFILES)" BFDLIB="$(TESTBFDLIB)" CTFLIB="$(TESTCTFLIB) $(ZLIB)" \ - SFRAMELIB="$(TESTSFRAMELIB)" \ -+ JANSSON_LIBS="$(JANSSON_LIBS)" ZSTD_LIBS="$(ZSTD_LIBS)" \ - LIBIBERTY="$(LIBIBERTY) $(LIBINTL)" LIBS="$(LIBS)" \ - DO_COMPARE="`echo '$(do_compare)' | sed -e 's,\\$$,,g'`" \ - $(RUNTESTFLAGS); \ ---- a/ld/testsuite/ld-bootstrap/bootstrap.exp -+++ b/ld/testsuite/ld-bootstrap/bootstrap.exp -@@ -162,13 +162,13 @@ foreach flags $test_flags { - } - - if { [lindex [remote_exec build grep "-q \"HAVE_ZSTD 1\" config.h" ] 0] == 0 } then { -- set extralibs "$extralibs -lzstd" -+ set extralibs "$extralibs $ZSTD_LIBS" - } - - # Check if the system's jansson library is used. If so, the object files will - # be using symbols from it, so link to it. - if { [lindex [remote_exec build grep "-q \"HAVE_JANSSON 1\" config.h" ] 0] == 0 } then { -- set extralibs "$extralibs -ljansson" -+ set extralibs "$extralibs $JANSSON_LIBS" - } - - # Plugin support requires linking with libdl. diff --git a/toolchain/binutils/patches/2.40/036-Regen-config-files.patch b/toolchain/binutils/patches/2.40/036-Regen-config-files.patch deleted file mode 100644 index 1c80dde310..0000000000 --- a/toolchain/binutils/patches/2.40/036-Regen-config-files.patch +++ /dev/null @@ -1,714 +0,0 @@ -From 1fc096a4c590f28e0efb1823cdca653f2db9de74 Mon Sep 17 00:00:00 2001 -From: Alan Modra <amodra@gmail.com> -Date: Mon, 6 Feb 2023 10:48:59 +1030 -Subject: [PATCH 36/50] Regen config files - -For the version update to 2.40.0 ---- - bfd/configure | 20 ++++++++++---------- - binutils/configure | 20 ++++++++++---------- - gas/configure | 20 ++++++++++---------- - gprof/configure | 20 ++++++++++---------- - gprofng/configure | 20 ++++++++++---------- - gprofng/doc/version.texi | 8 ++++---- - gprofng/libcollector/configure | 20 ++++++++++---------- - intl/configure | 3 +++ - ld/configure | 20 ++++++++++---------- - opcodes/configure | 20 ++++++++++---------- - 10 files changed, 87 insertions(+), 84 deletions(-) - ---- a/bfd/configure -+++ b/bfd/configure -@@ -1,6 +1,6 @@ - #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. --# Generated by GNU Autoconf 2.69 for bfd 2.40. -+# Generated by GNU Autoconf 2.69 for bfd 2.40.0. - # - # - # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -@@ -587,8 +587,8 @@ MAKEFLAGS= - # Identity of this package. - PACKAGE_NAME='bfd' - PACKAGE_TARNAME='bfd' --PACKAGE_VERSION='2.40' --PACKAGE_STRING='bfd 2.40' -+PACKAGE_VERSION='2.40.0' -+PACKAGE_STRING='bfd 2.40.0' - PACKAGE_BUGREPORT='' - PACKAGE_URL='' - -@@ -1400,7 +1400,7 @@ if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF --\`configure' configures bfd 2.40 to adapt to many kinds of systems. -+\`configure' configures bfd 2.40.0 to adapt to many kinds of systems. - - Usage: $0 [OPTION]... [VAR=VALUE]... - -@@ -1471,7 +1471,7 @@ fi - - if test -n "$ac_init_help"; then - case $ac_init_help in -- short | recursive ) echo "Configuration of bfd 2.40:";; -+ short | recursive ) echo "Configuration of bfd 2.40.0:";; - esac - cat <<\_ACEOF - -@@ -1608,7 +1608,7 @@ fi - test -n "$ac_init_help" && exit $ac_status - if $ac_init_version; then - cat <<\_ACEOF --bfd configure 2.40 -+bfd configure 2.40.0 - generated by GNU Autoconf 2.69 - - Copyright (C) 2012 Free Software Foundation, Inc. -@@ -2202,7 +2202,7 @@ cat >config.log <<_ACEOF - This file contains any messages produced by compilers while - running configure, to aid debugging if configure makes a mistake. - --It was created by bfd $as_me 2.40, which was -+It was created by bfd $as_me 2.40.0, which was - generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ -@@ -3184,7 +3184,7 @@ fi - - # Define the identity of the package. - PACKAGE='bfd' -- VERSION='2.40' -+ VERSION='2.40.0' - - - cat >>confdefs.h <<_ACEOF -@@ -15906,7 +15906,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri - # report actual input values of CONFIG_FILES etc. instead of their - # values after options handling. - ac_log=" --This file was extended by bfd $as_me 2.40, which was -+This file was extended by bfd $as_me 2.40.0, which was - generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES -@@ -15972,7 +15972,7 @@ _ACEOF - cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" - ac_cs_version="\\ --bfd config.status 2.40 -+bfd config.status 2.40.0 - configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - ---- a/binutils/configure -+++ b/binutils/configure -@@ -1,6 +1,6 @@ - #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. --# Generated by GNU Autoconf 2.69 for binutils 2.40. -+# Generated by GNU Autoconf 2.69 for binutils 2.40.0. - # - # - # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -@@ -587,8 +587,8 @@ MAKEFLAGS= - # Identity of this package. - PACKAGE_NAME='binutils' - PACKAGE_TARNAME='binutils' --PACKAGE_VERSION='2.40' --PACKAGE_STRING='binutils 2.40' -+PACKAGE_VERSION='2.40.0' -+PACKAGE_STRING='binutils 2.40.0' - PACKAGE_BUGREPORT='' - PACKAGE_URL='' - -@@ -1401,7 +1401,7 @@ if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF --\`configure' configures binutils 2.40 to adapt to many kinds of systems. -+\`configure' configures binutils 2.40.0 to adapt to many kinds of systems. - - Usage: $0 [OPTION]... [VAR=VALUE]... - -@@ -1472,7 +1472,7 @@ fi - - if test -n "$ac_init_help"; then - case $ac_init_help in -- short | recursive ) echo "Configuration of binutils 2.40:";; -+ short | recursive ) echo "Configuration of binutils 2.40.0:";; - esac - cat <<\_ACEOF - -@@ -1631,7 +1631,7 @@ fi - test -n "$ac_init_help" && exit $ac_status - if $ac_init_version; then - cat <<\_ACEOF --binutils configure 2.40 -+binutils configure 2.40.0 - generated by GNU Autoconf 2.69 - - Copyright (C) 2012 Free Software Foundation, Inc. -@@ -2099,7 +2099,7 @@ cat >config.log <<_ACEOF - This file contains any messages produced by compilers while - running configure, to aid debugging if configure makes a mistake. - --It was created by binutils $as_me 2.40, which was -+It was created by binutils $as_me 2.40.0, which was - generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ -@@ -3081,7 +3081,7 @@ fi - - # Define the identity of the package. - PACKAGE='binutils' -- VERSION='2.40' -+ VERSION='2.40.0' - - - cat >>confdefs.h <<_ACEOF -@@ -15326,7 +15326,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri - # report actual input values of CONFIG_FILES etc. instead of their - # values after options handling. - ac_log=" --This file was extended by binutils $as_me 2.40, which was -+This file was extended by binutils $as_me 2.40.0, which was - generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES -@@ -15392,7 +15392,7 @@ _ACEOF - cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" - ac_cs_version="\\ --binutils config.status 2.40 -+binutils config.status 2.40.0 - configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - ---- a/gas/configure -+++ b/gas/configure -@@ -1,6 +1,6 @@ - #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. --# Generated by GNU Autoconf 2.69 for gas 2.40. -+# Generated by GNU Autoconf 2.69 for gas 2.40.0. - # - # - # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -@@ -587,8 +587,8 @@ MAKEFLAGS= - # Identity of this package. - PACKAGE_NAME='gas' - PACKAGE_TARNAME='gas' --PACKAGE_VERSION='2.40' --PACKAGE_STRING='gas 2.40' -+PACKAGE_VERSION='2.40.0' -+PACKAGE_STRING='gas 2.40.0' - PACKAGE_BUGREPORT='' - PACKAGE_URL='' - -@@ -1381,7 +1381,7 @@ if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF --\`configure' configures gas 2.40 to adapt to many kinds of systems. -+\`configure' configures gas 2.40.0 to adapt to many kinds of systems. - - Usage: $0 [OPTION]... [VAR=VALUE]... - -@@ -1452,7 +1452,7 @@ fi - - if test -n "$ac_init_help"; then - case $ac_init_help in -- short | recursive ) echo "Configuration of gas 2.40:";; -+ short | recursive ) echo "Configuration of gas 2.40.0:";; - esac - cat <<\_ACEOF - -@@ -1600,7 +1600,7 @@ fi - test -n "$ac_init_help" && exit $ac_status - if $ac_init_version; then - cat <<\_ACEOF --gas configure 2.40 -+gas configure 2.40.0 - generated by GNU Autoconf 2.69 - - Copyright (C) 2012 Free Software Foundation, Inc. -@@ -2011,7 +2011,7 @@ cat >config.log <<_ACEOF - This file contains any messages produced by compilers while - running configure, to aid debugging if configure makes a mistake. - --It was created by gas $as_me 2.40, which was -+It was created by gas $as_me 2.40.0, which was - generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ -@@ -2990,7 +2990,7 @@ fi - - # Define the identity of the package. - PACKAGE='gas' -- VERSION='2.40' -+ VERSION='2.40.0' - - - cat >>confdefs.h <<_ACEOF -@@ -14910,7 +14910,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri - # report actual input values of CONFIG_FILES etc. instead of their - # values after options handling. - ac_log=" --This file was extended by gas $as_me 2.40, which was -+This file was extended by gas $as_me 2.40.0, which was - generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES -@@ -14976,7 +14976,7 @@ _ACEOF - cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" - ac_cs_version="\\ --gas config.status 2.40 -+gas config.status 2.40.0 - configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - ---- a/gprof/configure -+++ b/gprof/configure -@@ -1,6 +1,6 @@ - #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. --# Generated by GNU Autoconf 2.69 for gprof 2.40. -+# Generated by GNU Autoconf 2.69 for gprof 2.40.0. - # - # - # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -@@ -587,8 +587,8 @@ MAKEFLAGS= - # Identity of this package. - PACKAGE_NAME='gprof' - PACKAGE_TARNAME='gprof' --PACKAGE_VERSION='2.40' --PACKAGE_STRING='gprof 2.40' -+PACKAGE_VERSION='2.40.0' -+PACKAGE_STRING='gprof 2.40.0' - PACKAGE_BUGREPORT='' - PACKAGE_URL='' - -@@ -1338,7 +1338,7 @@ if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF --\`configure' configures gprof 2.40 to adapt to many kinds of systems. -+\`configure' configures gprof 2.40.0 to adapt to many kinds of systems. - - Usage: $0 [OPTION]... [VAR=VALUE]... - -@@ -1409,7 +1409,7 @@ fi - - if test -n "$ac_init_help"; then - case $ac_init_help in -- short | recursive ) echo "Configuration of gprof 2.40:";; -+ short | recursive ) echo "Configuration of gprof 2.40.0:";; - esac - cat <<\_ACEOF - -@@ -1520,7 +1520,7 @@ fi - test -n "$ac_init_help" && exit $ac_status - if $ac_init_version; then - cat <<\_ACEOF --gprof configure 2.40 -+gprof configure 2.40.0 - generated by GNU Autoconf 2.69 - - Copyright (C) 2012 Free Software Foundation, Inc. -@@ -1885,7 +1885,7 @@ cat >config.log <<_ACEOF - This file contains any messages produced by compilers while - running configure, to aid debugging if configure makes a mistake. - --It was created by gprof $as_me 2.40, which was -+It was created by gprof $as_me 2.40.0, which was - generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ -@@ -2864,7 +2864,7 @@ fi - - # Define the identity of the package. - PACKAGE='gprof' -- VERSION='2.40' -+ VERSION='2.40.0' - - - cat >>confdefs.h <<_ACEOF -@@ -12572,7 +12572,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri - # report actual input values of CONFIG_FILES etc. instead of their - # values after options handling. - ac_log=" --This file was extended by gprof $as_me 2.40, which was -+This file was extended by gprof $as_me 2.40.0, which was - generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES -@@ -12638,7 +12638,7 @@ _ACEOF - cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" - ac_cs_version="\\ --gprof config.status 2.40 -+gprof config.status 2.40.0 - configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - ---- a/gprofng/configure -+++ b/gprofng/configure -@@ -1,6 +1,6 @@ - #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. --# Generated by GNU Autoconf 2.69 for gprofng 2.40. -+# Generated by GNU Autoconf 2.69 for gprofng 2.40.0. - # - # - # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -@@ -587,8 +587,8 @@ MAKEFLAGS= - # Identity of this package. - PACKAGE_NAME='gprofng' - PACKAGE_TARNAME='gprofng' --PACKAGE_VERSION='2.40' --PACKAGE_STRING='gprofng 2.40' -+PACKAGE_VERSION='2.40.0' -+PACKAGE_STRING='gprofng 2.40.0' - PACKAGE_BUGREPORT='' - PACKAGE_URL='' - -@@ -1364,7 +1364,7 @@ if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF --\`configure' configures gprofng 2.40 to adapt to many kinds of systems. -+\`configure' configures gprofng 2.40.0 to adapt to many kinds of systems. - - Usage: $0 [OPTION]... [VAR=VALUE]... - -@@ -1435,7 +1435,7 @@ fi - - if test -n "$ac_init_help"; then - case $ac_init_help in -- short | recursive ) echo "Configuration of gprofng 2.40:";; -+ short | recursive ) echo "Configuration of gprofng 2.40.0:";; - esac - cat <<\_ACEOF - -@@ -1549,7 +1549,7 @@ fi - test -n "$ac_init_help" && exit $ac_status - if $ac_init_version; then - cat <<\_ACEOF --gprofng configure 2.40 -+gprofng configure 2.40.0 - generated by GNU Autoconf 2.69 - - Copyright (C) 2012 Free Software Foundation, Inc. -@@ -2081,7 +2081,7 @@ cat >config.log <<_ACEOF - This file contains any messages produced by compilers while - running configure, to aid debugging if configure makes a mistake. - --It was created by gprofng $as_me 2.40, which was -+It was created by gprofng $as_me 2.40.0, which was - generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ -@@ -3054,7 +3054,7 @@ fi - - # Define the identity of the package. - PACKAGE='gprofng' -- VERSION='2.40' -+ VERSION='2.40.0' - - - cat >>confdefs.h <<_ACEOF -@@ -17528,7 +17528,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri - # report actual input values of CONFIG_FILES etc. instead of their - # values after options handling. - ac_log=" --This file was extended by gprofng $as_me 2.40, which was -+This file was extended by gprofng $as_me 2.40.0, which was - generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES -@@ -17594,7 +17594,7 @@ _ACEOF - cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" - ac_cs_version="\\ --gprofng config.status 2.40 -+gprofng config.status 2.40.0 - configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - ---- a/gprofng/doc/version.texi -+++ b/gprofng/doc/version.texi -@@ -1,4 +1,4 @@ --@set UPDATED 5 January 2023 --@set UPDATED-MONTH January 2023 --@set EDITION 2.40 --@set VERSION 2.40 -+@set UPDATED 1 February 2023 -+@set UPDATED-MONTH February 2023 -+@set EDITION 2.40.0 -+@set VERSION 2.40.0 ---- a/gprofng/libcollector/configure -+++ b/gprofng/libcollector/configure -@@ -1,6 +1,6 @@ - #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. --# Generated by GNU Autoconf 2.69 for gprofng 2.40. -+# Generated by GNU Autoconf 2.69 for gprofng 2.40.0. - # - # - # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -@@ -587,8 +587,8 @@ MAKEFLAGS= - # Identity of this package. - PACKAGE_NAME='gprofng' - PACKAGE_TARNAME='gprofng' --PACKAGE_VERSION='2.40' --PACKAGE_STRING='gprofng 2.40' -+PACKAGE_VERSION='2.40.0' -+PACKAGE_STRING='gprofng 2.40.0' - PACKAGE_BUGREPORT='' - PACKAGE_URL='' - -@@ -1325,7 +1325,7 @@ if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF --\`configure' configures gprofng 2.40 to adapt to many kinds of systems. -+\`configure' configures gprofng 2.40.0 to adapt to many kinds of systems. - - Usage: $0 [OPTION]... [VAR=VALUE]... - -@@ -1396,7 +1396,7 @@ fi - - if test -n "$ac_init_help"; then - case $ac_init_help in -- short | recursive ) echo "Configuration of gprofng 2.40:";; -+ short | recursive ) echo "Configuration of gprofng 2.40.0:";; - esac - cat <<\_ACEOF - -@@ -1505,7 +1505,7 @@ fi - test -n "$ac_init_help" && exit $ac_status - if $ac_init_version; then - cat <<\_ACEOF --gprofng configure 2.40 -+gprofng configure 2.40.0 - generated by GNU Autoconf 2.69 - - Copyright (C) 2012 Free Software Foundation, Inc. -@@ -1991,7 +1991,7 @@ cat >config.log <<_ACEOF - This file contains any messages produced by compilers while - running configure, to aid debugging if configure makes a mistake. - --It was created by gprofng $as_me 2.40, which was -+It was created by gprofng $as_me 2.40.0, which was - generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ -@@ -2968,7 +2968,7 @@ fi - - # Define the identity of the package. - PACKAGE='gprofng' -- VERSION='2.40' -+ VERSION='2.40.0' - - - cat >>confdefs.h <<_ACEOF -@@ -16098,7 +16098,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri - # report actual input values of CONFIG_FILES etc. instead of their - # values after options handling. - ac_log=" --This file was extended by gprofng $as_me 2.40, which was -+This file was extended by gprofng $as_me 2.40.0, which was - generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES -@@ -16164,7 +16164,7 @@ _ACEOF - cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" - ac_cs_version="\\ --gprofng config.status 2.40 -+gprofng config.status 2.40.0 - configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - ---- a/intl/configure -+++ b/intl/configure -@@ -6857,6 +6857,9 @@ case "${host}" in - # sets the default TLS model and affects inlining. - PICFLAG=-fPIC - ;; -+ loongarch*-*-*) -+ PICFLAG=-fpic -+ ;; - mips-sgi-irix6*) - # PIC is the default. - ;; ---- a/ld/configure -+++ b/ld/configure -@@ -1,6 +1,6 @@ - #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. --# Generated by GNU Autoconf 2.69 for ld 2.40. -+# Generated by GNU Autoconf 2.69 for ld 2.40.0. - # - # - # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -@@ -587,8 +587,8 @@ MAKEFLAGS= - # Identity of this package. - PACKAGE_NAME='ld' - PACKAGE_TARNAME='ld' --PACKAGE_VERSION='2.40' --PACKAGE_STRING='ld 2.40' -+PACKAGE_VERSION='2.40.0' -+PACKAGE_STRING='ld 2.40.0' - PACKAGE_BUGREPORT='' - PACKAGE_URL='' - -@@ -1423,7 +1423,7 @@ if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF --\`configure' configures ld 2.40 to adapt to many kinds of systems. -+\`configure' configures ld 2.40.0 to adapt to many kinds of systems. - - Usage: $0 [OPTION]... [VAR=VALUE]... - -@@ -1494,7 +1494,7 @@ fi - - if test -n "$ac_init_help"; then - case $ac_init_help in -- short | recursive ) echo "Configuration of ld 2.40:";; -+ short | recursive ) echo "Configuration of ld 2.40.0:";; - esac - cat <<\_ACEOF - -@@ -1661,7 +1661,7 @@ fi - test -n "$ac_init_help" && exit $ac_status - if $ac_init_version; then - cat <<\_ACEOF --ld configure 2.40 -+ld configure 2.40.0 - generated by GNU Autoconf 2.69 - - Copyright (C) 2012 Free Software Foundation, Inc. -@@ -2376,7 +2376,7 @@ cat >config.log <<_ACEOF - This file contains any messages produced by compilers while - running configure, to aid debugging if configure makes a mistake. - --It was created by ld $as_me 2.40, which was -+It was created by ld $as_me 2.40.0, which was - generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ -@@ -3359,7 +3359,7 @@ fi - - # Define the identity of the package. - PACKAGE='ld' -- VERSION='2.40' -+ VERSION='2.40.0' - - - cat >>confdefs.h <<_ACEOF -@@ -18083,7 +18083,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri - # report actual input values of CONFIG_FILES etc. instead of their - # values after options handling. - ac_log=" --This file was extended by ld $as_me 2.40, which was -+This file was extended by ld $as_me 2.40.0, which was - generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES -@@ -18149,7 +18149,7 @@ _ACEOF - cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" - ac_cs_version="\\ --ld config.status 2.40 -+ld config.status 2.40.0 - configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - ---- a/opcodes/configure -+++ b/opcodes/configure -@@ -1,6 +1,6 @@ - #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. --# Generated by GNU Autoconf 2.69 for opcodes 2.40. -+# Generated by GNU Autoconf 2.69 for opcodes 2.40.0. - # - # - # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -@@ -587,8 +587,8 @@ MAKEFLAGS= - # Identity of this package. - PACKAGE_NAME='opcodes' - PACKAGE_TARNAME='opcodes' --PACKAGE_VERSION='2.40' --PACKAGE_STRING='opcodes 2.40' -+PACKAGE_VERSION='2.40.0' -+PACKAGE_STRING='opcodes 2.40.0' - PACKAGE_BUGREPORT='' - PACKAGE_URL='' - -@@ -1360,7 +1360,7 @@ if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF --\`configure' configures opcodes 2.40 to adapt to many kinds of systems. -+\`configure' configures opcodes 2.40.0 to adapt to many kinds of systems. - - Usage: $0 [OPTION]... [VAR=VALUE]... - -@@ -1431,7 +1431,7 @@ fi - - if test -n "$ac_init_help"; then - case $ac_init_help in -- short | recursive ) echo "Configuration of opcodes 2.40:";; -+ short | recursive ) echo "Configuration of opcodes 2.40.0:";; - esac - cat <<\_ACEOF - -@@ -1545,7 +1545,7 @@ fi - test -n "$ac_init_help" && exit $ac_status - if $ac_init_version; then - cat <<\_ACEOF --opcodes configure 2.40 -+opcodes configure 2.40.0 - generated by GNU Autoconf 2.69 - - Copyright (C) 2012 Free Software Foundation, Inc. -@@ -2139,7 +2139,7 @@ cat >config.log <<_ACEOF - This file contains any messages produced by compilers while - running configure, to aid debugging if configure makes a mistake. - --It was created by opcodes $as_me 2.40, which was -+It was created by opcodes $as_me 2.40.0, which was - generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ -@@ -3118,7 +3118,7 @@ fi - - # Define the identity of the package. - PACKAGE='opcodes' -- VERSION='2.40' -+ VERSION='2.40.0' - - - cat >>confdefs.h <<_ACEOF -@@ -13191,7 +13191,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri - # report actual input values of CONFIG_FILES etc. instead of their - # values after options handling. - ac_log=" --This file was extended by opcodes $as_me 2.40, which was -+This file was extended by opcodes $as_me 2.40.0, which was - generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES -@@ -13257,7 +13257,7 @@ _ACEOF - cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" - ac_cs_version="\\ --opcodes config.status 2.40 -+opcodes config.status 2.40.0 - configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - diff --git a/toolchain/binutils/patches/2.40/040-configure-remove-dependencies-on-gmp-and-mpfr-when-g.patch b/toolchain/binutils/patches/2.40/040-configure-remove-dependencies-on-gmp-and-mpfr-when-g.patch deleted file mode 100644 index 261acb549e..0000000000 --- a/toolchain/binutils/patches/2.40/040-configure-remove-dependencies-on-gmp-and-mpfr-when-g.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 17294931e3e361bee6810b1a39493e214b38c5e5 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= <chigot@adacore.com> -Date: Tue, 3 Jan 2023 14:24:43 +0100 -Subject: [PATCH 40/50] configure: remove dependencies on gmp and mpfr when gdb - is disabled - -Since 991180627851801f1999d1ebbc0e569a17e47c74, the configure checks -about GMP and MPFR for gdb builds have been moved to the toplevel -configure. -However, it doesn't take into account the --disable-gdb option. Meaning -that a build without gdb will require these libraries even if not -needed. - -ChangeLog: - - * configure.ac: Skip GMP and MPFR when --disable-gdb is - provided. - * configure: Regenerate. - -(cherry picked from commit 5fb0e308577143ceb313fde5538dc9ecb038f29f) ---- - configure | 4 +++- - configure.ac | 4 +++- - 2 files changed, 6 insertions(+), 2 deletions(-) - ---- a/configure -+++ b/configure -@@ -8032,7 +8032,9 @@ if test -d ${srcdir}/gcc ; then - require_mpc=yes - fi - if test -d ${srcdir}/gdb ; then -- require_gmp=yes -+ if test "x$enable_gdb" != xno; then -+ require_gmp=yes -+ fi - fi - - gmplibs="-lmpfr -lgmp" ---- a/configure.ac -+++ b/configure.ac -@@ -1585,7 +1585,9 @@ if test -d ${srcdir}/gcc ; then - require_mpc=yes - fi - if test -d ${srcdir}/gdb ; then -- require_gmp=yes -+ if test "x$enable_gdb" != xno; then -+ require_gmp=yes -+ fi - fi - - gmplibs="-lmpfr -lgmp" diff --git a/toolchain/binutils/patches/2.40/046-gas-correct-symbol-name-comparison-in-.startof.-.siz.patch b/toolchain/binutils/patches/2.40/046-gas-correct-symbol-name-comparison-in-.startof.-.siz.patch deleted file mode 100644 index 4e31bb43ed..0000000000 --- a/toolchain/binutils/patches/2.40/046-gas-correct-symbol-name-comparison-in-.startof.-.siz.patch +++ /dev/null @@ -1,46 +0,0 @@ -From b2bc62b7b4e7638c3a249d2d2728ceb4d5f2b22c Mon Sep 17 00:00:00 2001 -From: Jan Beulich <jbeulich@suse.com> -Date: Tue, 14 Feb 2023 08:35:02 +0100 -Subject: [PATCH 46/50] gas: correct symbol name comparison in - .startof./.sizeof. handling - -In 162c6aef1f3a ("gas: fold symbol table entries generated for -.startof.() / .sizeof.()") I screwed up quite badly, inverting the case -sensitive and case insensitive comparison functions. ---- - gas/expr.c | 4 ++-- - gas/testsuite/gas/elf/startof.d | 2 ++ - gas/testsuite/gas/elf/startof.s | 3 +++ - 3 files changed, 7 insertions(+), 2 deletions(-) - ---- a/gas/expr.c -+++ b/gas/expr.c -@@ -149,8 +149,8 @@ symbol_lookup_or_make (const char *name, - - name = S_GET_NAME (symbolP); - if ((symbols_case_sensitive -- ? strcasecmp (buf, name) -- : strcmp (buf, name)) == 0) -+ ? strcmp (buf, name) -+ : strcasecmp (buf, name)) == 0) - { - free (buf); - return symbolP; ---- a/gas/testsuite/gas/elf/startof.d -+++ b/gas/testsuite/gas/elf/startof.d -@@ -7,4 +7,6 @@ Symbol table .* - #... - [1-8]: 0+ .* UND \.startof\.\.text - [2-9]: 0+ .* UND \.sizeof\.\.text -+ +[1-9][0-9]*: 0+ .* UND \.startof\.\.Text -+ +[1-9][0-9]*: 0+ .* UND \.sizeof\.\.TEXT - #pass ---- a/gas/testsuite/gas/elf/startof.s -+++ b/gas/testsuite/gas/elf/startof.s -@@ -4,3 +4,6 @@ - .dc.a 0 - .dc.a .sizeof.(.text) - .dc.a .startof.(.text) -+ .dc.a 0 -+ .dc.a .startof.(.Text) -+ .dc.a .sizeof.(.TEXT) diff --git a/toolchain/binutils/patches/2.40/300-001_ld_makefile_patch.patch b/toolchain/binutils/patches/2.40/300-001_ld_makefile_patch.patch deleted file mode 100644 index 2dafd92a01..0000000000 --- a/toolchain/binutils/patches/2.40/300-001_ld_makefile_patch.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/ld/Makefile.am -+++ b/ld/Makefile.am -@@ -50,7 +50,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) - # We put the scripts in the directory $(scriptdir)/ldscripts. - # We can't put the scripts in $(datadir) because the SEARCH_DIR - # directives need to be different for native and cross linkers. --scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) - - EMUL = @EMUL@ - EMULATION_OFILES = @EMULATION_OFILES@ ---- a/ld/Makefile.in -+++ b/ld/Makefile.in -@@ -573,7 +573,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) - # We put the scripts in the directory $(scriptdir)/ldscripts. - # We can't put the scripts in $(datadir) because the SEARCH_DIR - # directives need to be different for native and cross linkers. --scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) - BASEDIR = $(srcdir)/.. - BFDDIR = $(BASEDIR)/bfd - INCDIR = $(BASEDIR)/include diff --git a/toolchain/binutils/patches/2.41/001-PR-30569-always-call-elf_backend_size_dynamic_sectio.patch b/toolchain/binutils/patches/2.41/001-PR-30569-always-call-elf_backend_size_dynamic_sectio.patch deleted file mode 100644 index 8cb7c041b0..0000000000 --- a/toolchain/binutils/patches/2.41/001-PR-30569-always-call-elf_backend_size_dynamic_sectio.patch +++ /dev/null @@ -1,2172 +0,0 @@ -From af969b14aedcc0ae27dcefab4327ff2d153dec8b Mon Sep 17 00:00:00 2001 -From: Alan Modra <amodra@gmail.com> -Date: Thu, 28 Mar 2024 19:25:42 +1030 -Subject: [PATCH 1/2] PR 30569, always call elf_backend_size_dynamic_sections - -This largely mechanical patch is preparation for a followup patch. - -For quite some time I've thought that it would be useful to call -elf_backend_size_dynamic_sections even when no dynamic objects are -seen by the linker. That's what this patch does, with some renaming. -There are no functional changes to the linker, just a move of the -dynobj test in bfd_elf_size_dynamic_sections to target backend -functions, replacing the asserts/aborts already there. No doubt some -of the current always_size_sections functions could be moved to -size_dynamic_sections but I haven't made that change. - -Because both hooks are now always called, I have renamed -always_size_sections to early_size_sections and size_dynamic_sections -to late_size_sections. I condisdered calling late_size_sections plain -size_sections, since this is the usual target dynamic section sizing -hook, but decided that searching the sources for "size_sections" would -then hit early_size_sections and other functions. ---- - bfd/elf-bfd.h | 35 +++++++++++++++++------------------ - bfd/elf-m10300.c | 11 ++++++----- - bfd/elf32-arc.c | 9 +++++---- - bfd/elf32-arm.c | 15 ++++++++------- - bfd/elf32-bfin.c | 31 ++++++++++++++++--------------- - bfd/elf32-cr16.c | 11 ++++++----- - bfd/elf32-cris.c | 13 +++++++------ - bfd/elf32-csky.c | 8 ++++---- - bfd/elf32-frv.c | 23 ++++++++++++----------- - bfd/elf32-hppa.c | 8 ++++---- - bfd/elf32-i386.c | 7 +++---- - bfd/elf32-lm32.c | 15 ++++++++------- - bfd/elf32-m32c.c | 8 ++++---- - bfd/elf32-m32r.c | 11 ++++++----- - bfd/elf32-m68k.c | 16 ++++++++-------- - bfd/elf32-metag.c | 8 ++++---- - bfd/elf32-microblaze.c | 9 +++++---- - bfd/elf32-mips.c | 6 ++---- - bfd/elf32-nds32.c | 9 +++++---- - bfd/elf32-nios2.c | 15 ++++++++------- - bfd/elf32-or1k.c | 9 +++++---- - bfd/elf32-ppc.c | 11 ++++++----- - bfd/elf32-rl78.c | 8 ++++---- - bfd/elf32-s390.c | 10 +++++----- - bfd/elf32-score.c | 35 ++++++++++++++++++----------------- - bfd/elf32-score.h | 4 ++-- - bfd/elf32-score7.c | 13 +++++++------ - bfd/elf32-sh.c | 15 +++++++-------- - bfd/elf32-sparc.c | 3 +-- - bfd/elf32-tic6x.c | 14 +++++++------- - bfd/elf32-tilegx.c | 2 +- - bfd/elf32-tilepro.c | 11 +++++------ - bfd/elf32-vax.c | 16 +++++++--------- - bfd/elf32-xstormy16.c | 8 ++++---- - bfd/elf32-xtensa.c | 13 ++++++------- - bfd/elf64-alpha.c | 19 ++++++++++--------- - bfd/elf64-hppa.c | 11 ++++------- - bfd/elf64-ia64-vms.c | 13 +++++++------ - bfd/elf64-mips.c | 8 ++++---- - bfd/elf64-ppc.c | 12 ++++++------ - bfd/elf64-s390.c | 10 +++++----- - bfd/elf64-sparc.c | 4 ++-- - bfd/elf64-tilegx.c | 2 +- - bfd/elf64-x86-64.c | 7 +++---- - bfd/elflink.c | 9 ++++----- - bfd/elfn32-mips.c | 6 ++---- - bfd/elfnn-aarch64.c | 21 +++++++++++---------- - bfd/elfnn-ia64.c | 11 ++++++----- - bfd/elfnn-kvx.c | 19 +++++++++---------- - bfd/elfnn-loongarch.c | 9 +++++---- - bfd/elfnn-riscv.c | 7 ++++--- - bfd/elfxx-mips.c | 15 ++++++++------- - bfd/elfxx-mips.h | 4 ++-- - bfd/elfxx-sparc.c | 7 ++++--- - bfd/elfxx-sparc.h | 2 +- - bfd/elfxx-target.h | 12 ++++++------ - bfd/elfxx-tilegx.c | 7 ++++--- - bfd/elfxx-tilegx.h | 2 +- - bfd/elfxx-x86.c | 8 ++++---- - bfd/elfxx-x86.h | 8 ++++---- - ld/emultempl/vms.em | 7 +++---- - 61 files changed, 343 insertions(+), 337 deletions(-) - ---- a/bfd/elf-bfd.h -+++ b/bfd/elf-bfd.h -@@ -1173,7 +1173,7 @@ struct elf_backend_data - /* The ADJUST_DYNAMIC_SYMBOL function is called by the ELF backend - linker for every symbol which is defined by a dynamic object and - referenced by a regular object. This is called after all the -- input files have been seen, but before the SIZE_DYNAMIC_SECTIONS -+ input files have been seen, but before the LATE_SIZE_SECTIONS - function has been called. The hash table entry should be - bfd_link_hash_defined ore bfd_link_hash_defweak, and it should be - defined in a section from a dynamic object. Dynamic object -@@ -1185,24 +1185,23 @@ struct elf_backend_data - bool (*elf_backend_adjust_dynamic_symbol) - (struct bfd_link_info *info, struct elf_link_hash_entry *h); - -- /* The ALWAYS_SIZE_SECTIONS function is called by the backend linker -- after all the linker input files have been seen but before the -- section sizes have been set. This is called after -- ADJUST_DYNAMIC_SYMBOL, but before SIZE_DYNAMIC_SECTIONS. */ -- bool (*elf_backend_always_size_sections) -+ /* The EARLY_SIZE_SECTIONS and LATE_SIZE_SECTIONS functions are -+ called by the backend linker after all linker input files have -+ been seen and sections have been assigned to output sections, but -+ before the section sizes have been set. Both of these functions -+ are called even when no dynamic object is seen by the linker. -+ Between them, they must set the sizes of the dynamic sections and -+ other backend specific sections, and may fill in their contents. -+ Most backends need only use LATE_SIZE_SECTIONS. -+ EARLY_SIZE_SECTIONS is called before --export-dynamic makes some -+ symbols dynamic and before ADJUST_DYNAMIC_SYMBOL processes -+ dynamic symbols, LATE_SIZE_SECTIONS afterwards. The generic ELF -+ linker can handle the .dynsym, .dynstr and .hash sections. -+ Besides those, these functions must handle the .interp section -+ and any other sections created by CREATE_DYNAMIC_SECTIONS. */ -+ bool (*elf_backend_early_size_sections) - (bfd *output_bfd, struct bfd_link_info *info); -- -- /* The SIZE_DYNAMIC_SECTIONS function is called by the ELF backend -- linker after all the linker input files have been seen but before -- the sections sizes have been set. This is called after -- ADJUST_DYNAMIC_SYMBOL has been called on all appropriate symbols. -- It is only called when linking against a dynamic object. It must -- set the sizes of the dynamic sections, and may fill in their -- contents as well. The generic ELF linker can handle the .dynsym, -- .dynstr and .hash sections. This function must handle the -- .interp section and any sections created by the -- CREATE_DYNAMIC_SECTIONS entry point. */ -- bool (*elf_backend_size_dynamic_sections) -+ bool (*elf_backend_late_size_sections) - (bfd *output_bfd, struct bfd_link_info *info); - - /* The STRIP_ZERO_SIZED_DYNAMIC_SECTIONS function is called by the ---- a/bfd/elf-m10300.c -+++ b/bfd/elf-m10300.c -@@ -5015,8 +5015,8 @@ _bfd_mn10300_elf_adjust_dynamic_symbol ( - /* Set the sizes of the dynamic sections. */ - - static bool --_bfd_mn10300_elf_size_dynamic_sections (bfd * output_bfd, -- struct bfd_link_info * info) -+_bfd_mn10300_elf_late_size_sections (bfd * output_bfd, -+ struct bfd_link_info * info) - { - struct elf32_mn10300_link_hash_table *htab = elf32_mn10300_hash_table (info); - bfd * dynobj; -@@ -5024,7 +5024,8 @@ _bfd_mn10300_elf_size_dynamic_sections ( - bool relocs; - - dynobj = htab->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -5511,8 +5512,8 @@ mn10300_elf_mkobject (bfd *abfd) - _bfd_mn10300_elf_create_dynamic_sections - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mn10300_elf_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections \ -- _bfd_mn10300_elf_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ _bfd_mn10300_elf_late_size_sections - #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all - #define elf_backend_finish_dynamic_symbol \ - _bfd_mn10300_elf_finish_dynamic_symbol ---- a/bfd/elf32-arc.c -+++ b/bfd/elf32-arc.c -@@ -2702,8 +2702,8 @@ elf_arc_finish_dynamic_sections (bfd * o - - /* Set the sizes of the dynamic sections. */ - static bool --elf_arc_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_arc_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; -@@ -2711,7 +2711,8 @@ elf_arc_size_dynamic_sections (bfd *outp - struct elf_link_hash_table *htab = elf_hash_table (info); - - dynobj = htab->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->dynamic_sections_created) - { -@@ -3127,7 +3128,7 @@ arc_elf_relax_section (bfd *abfd, asecti - #define elf_backend_finish_dynamic_symbol elf_arc_finish_dynamic_symbol - - #define elf_backend_finish_dynamic_sections elf_arc_finish_dynamic_sections --#define elf_backend_size_dynamic_sections elf_arc_size_dynamic_sections -+#define elf_backend_late_size_sections elf_arc_late_size_sections - - #define elf_backend_can_gc_sections 1 - #define elf_backend_want_got_plt 1 ---- a/bfd/elf32-arm.c -+++ b/bfd/elf32-arm.c -@@ -16751,8 +16751,8 @@ bfd_elf32_arm_set_byteswap_code (struct - /* Set the sizes of the dynamic sections. */ - - static bool --elf32_arm_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info * info) -+elf32_arm_late_size_sections (bfd * output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info * info) - { - bfd * dynobj; - asection * s; -@@ -16765,7 +16765,9 @@ elf32_arm_size_dynamic_sections (bfd * o - return false; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; -+ - check_use_blx (htab); - - if (elf_hash_table (info)->dynamic_sections_created) -@@ -17137,8 +17139,7 @@ elf32_arm_size_dynamic_sections (bfd * o - _TLS_MODULE_BASE_, if needed. */ - - static bool --elf32_arm_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf32_arm_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - asection *tls_sec; - struct elf32_arm_link_hash_table *htab; -@@ -20332,8 +20333,8 @@ elf32_arm_backend_symbol_processing (bfd - #define elf_backend_create_dynamic_sections elf32_arm_create_dynamic_sections - #define elf_backend_finish_dynamic_symbol elf32_arm_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections elf32_arm_finish_dynamic_sections --#define elf_backend_size_dynamic_sections elf32_arm_size_dynamic_sections --#define elf_backend_always_size_sections elf32_arm_always_size_sections -+#define elf_backend_late_size_sections elf32_arm_late_size_sections -+#define elf_backend_early_size_sections elf32_arm_early_size_sections - #define elf_backend_init_index_section _bfd_elf_init_2_index_sections - #define elf_backend_init_file_header elf32_arm_init_file_header - #define elf_backend_reloc_type_class elf32_arm_reloc_type_class ---- a/bfd/elf32-bfin.c -+++ b/bfd/elf32-bfin.c -@@ -4027,8 +4027,8 @@ _bfinfdpic_size_got_plt (bfd *output_bfd - /* Set the sizes of the dynamic sections. */ - - static bool --elf32_bfinfdpic_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf32_bfinfdpic_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - struct elf_link_hash_table *htab; - bfd *dynobj; -@@ -4037,7 +4037,8 @@ elf32_bfinfdpic_size_dynamic_sections (b - - htab = elf_hash_table (info); - dynobj = htab->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->dynamic_sections_created) - { -@@ -4086,7 +4087,7 @@ elf32_bfinfdpic_size_dynamic_sections (b - } - - static bool --elf32_bfinfdpic_always_size_sections (bfd *output_bfd, -+elf32_bfinfdpic_early_size_sections (bfd *output_bfd, - struct bfd_link_info *info) - { - if (!bfd_link_relocatable (info) -@@ -5123,15 +5124,16 @@ bfin_discard_copies (struct elf_link_has - } - - static bool --bfin_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+bfin_late_size_sections (bfd * output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; - bool relocs; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -5423,8 +5425,7 @@ struct bfd_elf_special_section const elf - #define elf_backend_check_relocs bfin_check_relocs - #define elf_backend_adjust_dynamic_symbol \ - bfin_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections \ -- bfin_size_dynamic_sections -+#define elf_backend_late_size_sections bfin_late_size_sections - #define elf_backend_relocate_section bfin_relocate_section - #define elf_backend_finish_dynamic_symbol \ - bfin_finish_dynamic_symbol -@@ -5470,9 +5471,9 @@ struct bfd_elf_special_section const elf - #undef bfd_elf32_bfd_link_hash_table_create - #define bfd_elf32_bfd_link_hash_table_create \ - bfinfdpic_elf_link_hash_table_create --#undef elf_backend_always_size_sections --#define elf_backend_always_size_sections \ -- elf32_bfinfdpic_always_size_sections -+#undef elf_backend_early_size_sections -+#define elf_backend_early_size_sections \ -+ elf32_bfinfdpic_early_size_sections - - #undef elf_backend_create_dynamic_sections - #define elf_backend_create_dynamic_sections \ -@@ -5480,9 +5481,9 @@ struct bfd_elf_special_section const elf - #undef elf_backend_adjust_dynamic_symbol - #define elf_backend_adjust_dynamic_symbol \ - elf32_bfinfdpic_adjust_dynamic_symbol --#undef elf_backend_size_dynamic_sections --#define elf_backend_size_dynamic_sections \ -- elf32_bfinfdpic_size_dynamic_sections -+#undef elf_backend_late_size_sections -+#define elf_backend_late_size_sections \ -+ elf32_bfinfdpic_late_size_sections - #undef elf_backend_finish_dynamic_symbol - #define elf_backend_finish_dynamic_symbol \ - elf32_bfinfdpic_finish_dynamic_symbol ---- a/bfd/elf32-cr16.c -+++ b/bfd/elf32-cr16.c -@@ -2391,15 +2391,16 @@ _bfd_cr16_elf_adjust_dynamic_symbol (str - /* Set the sizes of the dynamic sections. */ - - static bool --_bfd_cr16_elf_size_dynamic_sections (bfd * output_bfd, -- struct bfd_link_info * info) -+_bfd_cr16_elf_late_size_sections (bfd * output_bfd, -+ struct bfd_link_info * info) - { - bfd * dynobj; - asection * s; - bool relocs; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -2836,8 +2837,8 @@ _bfd_cr16_elf_reloc_type_class (const st - _bfd_cr16_elf_create_dynamic_sections - #define elf_backend_adjust_dynamic_symbol \ - _bfd_cr16_elf_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections \ -- _bfd_cr16_elf_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ _bfd_cr16_elf_late_size_sections - #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all - #define elf_backend_finish_dynamic_symbol \ - _bfd_cr16_elf_finish_dynamic_symbol ---- a/bfd/elf32-cris.c -+++ b/bfd/elf32-cris.c -@@ -2527,7 +2527,7 @@ cris_elf_plt_sym_val (bfd_vma i ATTRIBUT - entry but we found we will not create any. Called when we find we will - not have any PLT for this symbol, by for example - elf_cris_adjust_dynamic_symbol when we're doing a proper dynamic link, -- or elf_cris_size_dynamic_sections if no dynamic sections will be -+ or elf_cris_late_size_sections if no dynamic sections will be - created (we're only linking static objects). */ - - static bool -@@ -3508,8 +3508,8 @@ cris_elf_check_relocs (bfd *abfd, - /* Set the sizes of the dynamic sections. */ - - static bool --elf_cris_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_cris_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_cris_link_hash_table * htab; - bfd *dynobj; -@@ -3521,7 +3521,8 @@ elf_cris_size_dynamic_sections (bfd *out - return false; - - dynobj = htab->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->root.dynamic_sections_created) - { -@@ -4090,8 +4091,8 @@ elf_cris_got_elt_size (bfd *abfd ATTRIBU - elf_cris_adjust_dynamic_symbol - #define elf_backend_copy_indirect_symbol \ - elf_cris_copy_indirect_symbol --#define elf_backend_size_dynamic_sections \ -- elf_cris_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ elf_cris_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_finish_dynamic_symbol \ - elf_cris_finish_dynamic_symbol ---- a/bfd/elf32-csky.c -+++ b/bfd/elf32-csky.c -@@ -1893,8 +1893,8 @@ csky_allocate_dynrelocs (struct elf_link - /* Set the sizes of the dynamic sections. */ - - static bool --csky_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+csky_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct csky_elf_link_hash_table *htab; - bfd *dynobj; -@@ -1907,7 +1907,7 @@ csky_elf_size_dynamic_sections (bfd *out - return false; - dynobj = htab->elf.dynobj; - if (dynobj == NULL) -- return false; -+ return true; - - if (htab->elf.dynamic_sections_created) - { -@@ -5333,7 +5333,7 @@ elf32_csky_obj_attrs_handle_unknown (bfd - /* Dynamic relocate related API. */ - #define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections - #define elf_backend_adjust_dynamic_symbol csky_elf_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections csky_elf_size_dynamic_sections -+#define elf_backend_late_size_sections csky_elf_late_size_sections - #define elf_backend_finish_dynamic_symbol csky_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections csky_elf_finish_dynamic_sections - #define elf_backend_rela_normal 1 ---- a/bfd/elf32-frv.c -+++ b/bfd/elf32-frv.c -@@ -5423,15 +5423,16 @@ _frvfdpic_size_got_plt (bfd *output_bfd, - /* Set the sizes of the dynamic sections. */ - - static bool --elf32_frvfdpic_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf32_frvfdpic_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; - struct _frvfdpic_dynamic_got_plt_info gpinfo; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -5472,8 +5473,8 @@ elf32_frvfdpic_size_dynamic_sections (bf - } - - static bool --elf32_frvfdpic_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf32_frvfdpic_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - if (!bfd_link_relocatable (info) - && !bfd_elf_stack_segment_size (output_bfd, info, -@@ -6817,9 +6818,9 @@ elf32_frv_grok_psinfo (bfd *abfd, Elf_In - #undef bfd_elf32_bfd_link_hash_table_create - #define bfd_elf32_bfd_link_hash_table_create \ - frvfdpic_elf_link_hash_table_create --#undef elf_backend_always_size_sections --#define elf_backend_always_size_sections \ -- elf32_frvfdpic_always_size_sections -+#undef elf_backend_early_size_sections -+#define elf_backend_early_size_sections \ -+ elf32_frvfdpic_early_size_sections - - #undef elf_backend_create_dynamic_sections - #define elf_backend_create_dynamic_sections \ -@@ -6827,9 +6828,9 @@ elf32_frv_grok_psinfo (bfd *abfd, Elf_In - #undef elf_backend_adjust_dynamic_symbol - #define elf_backend_adjust_dynamic_symbol \ - elf32_frvfdpic_adjust_dynamic_symbol --#undef elf_backend_size_dynamic_sections --#define elf_backend_size_dynamic_sections \ -- elf32_frvfdpic_size_dynamic_sections -+#undef elf_backend_late_size_sections -+#define elf_backend_late_size_sections \ -+ elf32_frvfdpic_late_size_sections - #undef bfd_elf32_bfd_relax_section - #define bfd_elf32_bfd_relax_section \ - elf32_frvfdpic_relax_section ---- a/bfd/elf32-hppa.c -+++ b/bfd/elf32-hppa.c -@@ -2042,8 +2042,8 @@ clobber_millicode_symbols (struct elf_li - /* Set the sizes of the dynamic sections. */ - - static bool --elf32_hppa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf32_hppa_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf32_hppa_link_hash_table *htab; - bfd *dynobj; -@@ -2057,7 +2057,7 @@ elf32_hppa_size_dynamic_sections (bfd *o - - dynobj = htab->etab.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - if (htab->etab.dynamic_sections_created) - { -@@ -4450,7 +4450,7 @@ elf32_hppa_elf_get_symbol_type (Elf_Inte - #define elf_backend_hide_symbol elf32_hppa_hide_symbol - #define elf_backend_finish_dynamic_symbol elf32_hppa_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections elf32_hppa_finish_dynamic_sections --#define elf_backend_size_dynamic_sections elf32_hppa_size_dynamic_sections -+#define elf_backend_late_size_sections elf32_hppa_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_gc_mark_hook elf32_hppa_gc_mark_hook - #define elf_backend_grok_prstatus elf32_hppa_grok_prstatus ---- a/bfd/elf32-i386.c -+++ b/bfd/elf32-i386.c -@@ -1947,8 +1947,7 @@ elf_i386_scan_relocs (bfd *abfd, - } - - static bool --elf_i386_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf_i386_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - bfd *abfd; - -@@ -1961,7 +1960,7 @@ elf_i386_always_size_sections (bfd *outp - elf_i386_scan_relocs)) - return false; - -- return _bfd_x86_elf_always_size_sections (output_bfd, info); -+ return _bfd_x86_elf_early_size_sections (output_bfd, info); - } - - /* Set the correct type for an x86 ELF section. We do this by the -@@ -4469,7 +4468,7 @@ elf_i386_link_setup_gnu_properties (stru - #define bfd_elf32_get_synthetic_symtab elf_i386_get_synthetic_symtab - - #define elf_backend_relocs_compatible _bfd_elf_relocs_compatible --#define elf_backend_always_size_sections elf_i386_always_size_sections -+#define elf_backend_early_size_sections elf_i386_early_size_sections - #define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections - #define elf_backend_fake_sections elf_i386_fake_sections - #define elf_backend_finish_dynamic_sections elf_i386_finish_dynamic_sections ---- a/bfd/elf32-lm32.c -+++ b/bfd/elf32-lm32.c -@@ -1906,8 +1906,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --lm32_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+lm32_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - struct elf_lm32_link_hash_table *htab; - bfd *dynobj; -@@ -1920,7 +1920,8 @@ lm32_elf_size_dynamic_sections (bfd *out - return false; - - dynobj = htab->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->root.dynamic_sections_created) - { -@@ -2309,7 +2310,7 @@ lm32_elf_create_dynamic_sections (bfd *a - } - - static bool --lm32_elf_always_size_sections (bfd *output_bfd, struct bfd_link_info *info) -+lm32_elf_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - if (!bfd_link_relocatable (info)) - { -@@ -2395,7 +2396,7 @@ lm32_elf_fdpic_copy_private_bfd_data (bf - #define bfd_elf32_bfd_link_hash_table_create lm32_elf_link_hash_table_create - #define elf_backend_check_relocs lm32_elf_check_relocs - #define elf_backend_reloc_type_class lm32_elf_reloc_type_class --#define elf_backend_size_dynamic_sections lm32_elf_size_dynamic_sections -+#define elf_backend_late_size_sections lm32_elf_late_size_sections - #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all - #define elf_backend_create_dynamic_sections lm32_elf_create_dynamic_sections - #define elf_backend_finish_dynamic_sections lm32_elf_finish_dynamic_sections -@@ -2416,8 +2417,8 @@ lm32_elf_fdpic_copy_private_bfd_data (bf - #undef elf32_bed - #define elf32_bed elf32_lm32fdpic_bed - --#undef elf_backend_always_size_sections --#define elf_backend_always_size_sections lm32_elf_always_size_sections -+#undef elf_backend_early_size_sections -+#define elf_backend_early_size_sections lm32_elf_early_size_sections - #undef bfd_elf32_bfd_copy_private_bfd_data - #define bfd_elf32_bfd_copy_private_bfd_data lm32_elf_fdpic_copy_private_bfd_data - ---- a/bfd/elf32-m32c.c -+++ b/bfd/elf32-m32c.c -@@ -773,8 +773,8 @@ m32c_elf_finish_dynamic_sections (bfd *a - } - - static bool --m32c_elf_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+m32c_elf_early_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *splt; -@@ -2132,8 +2132,8 @@ _bfd_m32c_elf_eh_frame_address_size (bfd - #define elf_backend_check_relocs m32c_elf_check_relocs - #define elf_backend_object_p m32c_elf_object_p - #define elf_symbol_leading_char ('_') --#define elf_backend_always_size_sections \ -- m32c_elf_always_size_sections -+#define elf_backend_early_size_sections \ -+ m32c_elf_early_size_sections - #define elf_backend_finish_dynamic_sections \ - m32c_elf_finish_dynamic_sections - ---- a/bfd/elf32-m32r.c -+++ b/bfd/elf32-m32r.c -@@ -1958,8 +1958,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --m32r_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+m32r_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_link_hash_table *htab; - bfd *dynobj; -@@ -1968,7 +1968,7 @@ m32r_elf_size_dynamic_sections (bfd *out - bfd *ibfd; - - #ifdef DEBUG_PIC -- printf ("m32r_elf_size_dynamic_sections()\n"); -+ printf ("m32r_elf_late_size_sections()\n"); - #endif - - htab = m32r_elf_hash_table (info); -@@ -1976,7 +1976,8 @@ m32r_elf_size_dynamic_sections (bfd *out - return false; - - dynobj = htab->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->dynamic_sections_created) - { -@@ -3658,7 +3659,7 @@ m32r_elf_reloc_type_class (const struct - - #define elf_backend_create_dynamic_sections m32r_elf_create_dynamic_sections - #define bfd_elf32_bfd_link_hash_table_create m32r_elf_link_hash_table_create --#define elf_backend_size_dynamic_sections m32r_elf_size_dynamic_sections -+#define elf_backend_late_size_sections m32r_elf_late_size_sections - #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all - #define elf_backend_finish_dynamic_sections m32r_elf_finish_dynamic_sections - #define elf_backend_adjust_dynamic_symbol m32r_elf_adjust_dynamic_symbol ---- a/bfd/elf32-m68k.c -+++ b/bfd/elf32-m68k.c -@@ -2934,7 +2934,7 @@ elf_m68k_get_plt_info (bfd *output_bfd) - It's a convenient place to determine the PLT style. */ - - static bool --elf_m68k_always_size_sections (bfd *output_bfd, struct bfd_link_info *info) -+elf_m68k_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - /* Bind input BFDs to GOTs and calculate sizes of .got and .rela.got - sections. */ -@@ -3107,15 +3107,16 @@ elf_m68k_adjust_dynamic_symbol (struct b - /* Set the sizes of the dynamic sections. */ - - static bool --elf_m68k_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_m68k_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; - bool relocs; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -4628,12 +4629,11 @@ elf_m68k_grok_psinfo (bfd *abfd, Elf_Int - #define bfd_elf32_bfd_final_link bfd_elf_final_link - - #define elf_backend_check_relocs elf_m68k_check_relocs --#define elf_backend_always_size_sections \ -- elf_m68k_always_size_sections -+#define elf_backend_early_size_sections \ -+ elf_m68k_early_size_sections - #define elf_backend_adjust_dynamic_symbol \ - elf_m68k_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections \ -- elf_m68k_size_dynamic_sections -+#define elf_backend_late_size_sections elf_m68k_late_size_sections - #define elf_backend_final_write_processing elf_m68k_final_write_processing - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section elf_m68k_relocate_section ---- a/bfd/elf32-metag.c -+++ b/bfd/elf32-metag.c -@@ -2717,8 +2717,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --elf_metag_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_metag_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_metag_link_hash_table *htab; - bfd *dynobj; -@@ -2729,7 +2729,7 @@ elf_metag_size_dynamic_sections (bfd *ou - htab = metag_link_hash_table (info); - dynobj = htab->etab.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - if (htab->etab.dynamic_sections_created) - { -@@ -4019,7 +4019,7 @@ elf_metag_plt_sym_val (bfd_vma i, const - #define elf_backend_adjust_dynamic_symbol elf_metag_adjust_dynamic_symbol - #define elf_backend_finish_dynamic_symbol elf_metag_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections elf_metag_finish_dynamic_sections --#define elf_backend_size_dynamic_sections elf_metag_size_dynamic_sections -+#define elf_backend_late_size_sections elf_metag_late_size_sections - #define elf_backend_omit_section_dynsym \ - _bfd_elf_omit_section_dynsym_all - #define elf_backend_init_file_header elf_metag_init_file_header ---- a/bfd/elf32-microblaze.c -+++ b/bfd/elf32-microblaze.c -@@ -2946,8 +2946,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --microblaze_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+microblaze_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf32_mb_link_hash_table *htab; - bfd *dynobj; -@@ -2959,7 +2959,8 @@ microblaze_elf_size_dynamic_sections (bf - return false; - - dynobj = htab->elf.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - /* Set up .got offsets for local syms, and space for local dynamic - relocs. */ -@@ -3477,7 +3478,7 @@ microblaze_elf_add_symbol_hook (bfd *abf - #define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections - #define elf_backend_finish_dynamic_sections microblaze_elf_finish_dynamic_sections - #define elf_backend_finish_dynamic_symbol microblaze_elf_finish_dynamic_symbol --#define elf_backend_size_dynamic_sections microblaze_elf_size_dynamic_sections -+#define elf_backend_late_size_sections microblaze_elf_late_size_sections - #define elf_backend_add_symbol_hook microblaze_elf_add_symbol_hook - - #include "elf32-target.h" ---- a/bfd/elf32-mips.c -+++ b/bfd/elf32-mips.c -@@ -2537,10 +2537,8 @@ static const struct ecoff_debug_swap mip - #define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mips_elf_adjust_dynamic_symbol --#define elf_backend_always_size_sections \ -- _bfd_mips_elf_always_size_sections --#define elf_backend_size_dynamic_sections \ -- _bfd_mips_elf_size_dynamic_sections -+#define elf_backend_early_size_sections _bfd_mips_elf_early_size_sections -+#define elf_backend_late_size_sections _bfd_mips_elf_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section _bfd_mips_elf_relocate_section - #define elf_backend_finish_dynamic_symbol \ ---- a/bfd/elf32-nds32.c -+++ b/bfd/elf32-nds32.c -@@ -4302,8 +4302,8 @@ elf32_nds32_add_dynreloc (bfd *output_bf - /* Set the sizes of the dynamic sections. */ - - static bool --nds32_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+nds32_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_nds32_link_hash_table *htab; - bfd *dynobj; -@@ -4316,7 +4316,8 @@ nds32_elf_size_dynamic_sections (bfd *ou - return false; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -13984,7 +13985,7 @@ nds32_elf_unify_tls_model (bfd *inbfd, a - #define elf_backend_create_dynamic_sections nds32_elf_create_dynamic_sections - #define elf_backend_finish_dynamic_sections nds32_elf_finish_dynamic_sections - #define elf_backend_finish_dynamic_symbol nds32_elf_finish_dynamic_symbol --#define elf_backend_size_dynamic_sections nds32_elf_size_dynamic_sections -+#define elf_backend_late_size_sections nds32_elf_late_size_sections - #define elf_backend_relocate_section nds32_elf_relocate_section - #define elf_backend_gc_mark_hook nds32_elf_gc_mark_hook - #define elf_backend_grok_prstatus nds32_elf_grok_prstatus ---- a/bfd/elf32-nios2.c -+++ b/bfd/elf32-nios2.c -@@ -5405,7 +5405,7 @@ nios2_elf32_adjust_dynamic_symbol (struc - return true; - } - --/* Worker function for nios2_elf32_size_dynamic_sections. */ -+/* Worker function for nios2_elf32_late_size_sections. */ - static bool - adjust_dynrelocs (struct elf_link_hash_entry *h, void *inf) - { -@@ -5432,7 +5432,7 @@ adjust_dynrelocs (struct elf_link_hash_e - return true; - } - --/* Another worker function for nios2_elf32_size_dynamic_sections. -+/* Another worker function for nios2_elf32_late_size_sections. - Allocate space in .plt, .got and associated reloc sections for - dynamic relocs. */ - static bool -@@ -5667,11 +5667,11 @@ allocate_dynrelocs (struct elf_link_hash - return true; - } - --/* Implement elf_backend_size_dynamic_sections: -+/* Implement elf_backend_late_size_sections: - Set the sizes of the dynamic sections. */ - static bool --nios2_elf32_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+nios2_elf32_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; -@@ -5681,7 +5681,8 @@ nios2_elf32_size_dynamic_sections (bfd * - - htab = elf32_nios2_hash_table (info); - dynobj = htab->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - htab->res_n_size = 0; - if (htab->root.dynamic_sections_created) -@@ -6052,7 +6053,7 @@ const struct bfd_elf_special_section elf - nios2_elf32_finish_dynamic_sections - #define elf_backend_adjust_dynamic_symbol nios2_elf32_adjust_dynamic_symbol - #define elf_backend_reloc_type_class nios2_elf32_reloc_type_class --#define elf_backend_size_dynamic_sections nios2_elf32_size_dynamic_sections -+#define elf_backend_late_size_sections nios2_elf32_late_size_sections - #define elf_backend_add_symbol_hook nios2_elf_add_symbol_hook - #define elf_backend_copy_indirect_symbol nios2_elf32_copy_indirect_symbol - #define elf_backend_object_p nios2_elf32_object_p ---- a/bfd/elf32-or1k.c -+++ b/bfd/elf32-or1k.c -@@ -3047,8 +3047,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --or1k_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+or1k_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_or1k_link_hash_table *htab; - bfd *dynobj; -@@ -3061,7 +3061,8 @@ or1k_elf_size_dynamic_sections (bfd *out - return false; - - dynobj = htab->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->root.dynamic_sections_created) - { -@@ -3414,7 +3415,7 @@ or1k_grok_psinfo (bfd *abfd, Elf_Interna - #define elf_backend_copy_indirect_symbol or1k_elf_copy_indirect_symbol - #define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections - #define elf_backend_finish_dynamic_sections or1k_elf_finish_dynamic_sections --#define elf_backend_size_dynamic_sections or1k_elf_size_dynamic_sections -+#define elf_backend_late_size_sections or1k_elf_late_size_sections - #define elf_backend_adjust_dynamic_symbol or1k_elf_adjust_dynamic_symbol - #define elf_backend_finish_dynamic_symbol or1k_elf_finish_dynamic_symbol - ---- a/bfd/elf32-ppc.c -+++ b/bfd/elf32-ppc.c -@@ -5481,8 +5481,8 @@ static const unsigned char glink_eh_fram - /* Set the sizes of the dynamic sections. */ - - static bool --ppc_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+ppc_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - struct ppc_elf_link_hash_table *htab; - asection *s; -@@ -5490,11 +5490,12 @@ ppc_elf_size_dynamic_sections (bfd *outp - bfd *ibfd; - - #ifdef DEBUG -- fprintf (stderr, "ppc_elf_size_dynamic_sections called\n"); -+ fprintf (stderr, "ppc_elf_late_size_sections called\n"); - #endif - - htab = ppc_elf_hash_table (info); -- BFD_ASSERT (htab->elf.dynobj != NULL); -+ if (htab->elf.dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -10418,7 +10419,7 @@ ppc_elf_finish_dynamic_sections (bfd *ou - #define elf_backend_copy_indirect_symbol ppc_elf_copy_indirect_symbol - #define elf_backend_adjust_dynamic_symbol ppc_elf_adjust_dynamic_symbol - #define elf_backend_add_symbol_hook ppc_elf_add_symbol_hook --#define elf_backend_size_dynamic_sections ppc_elf_size_dynamic_sections -+#define elf_backend_late_size_sections ppc_elf_late_size_sections - #define elf_backend_hash_symbol ppc_elf_hash_symbol - #define elf_backend_finish_dynamic_symbol ppc_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections ppc_elf_finish_dynamic_sections ---- a/bfd/elf32-rl78.c -+++ b/bfd/elf32-rl78.c -@@ -1440,8 +1440,8 @@ rl78_elf_finish_dynamic_sections (bfd *a - } - - static bool --rl78_elf_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+rl78_elf_early_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *splt; -@@ -2610,8 +2610,8 @@ rl78_elf_relax_section (bfd *abfd, - - #define bfd_elf32_bfd_relax_section rl78_elf_relax_section - #define elf_backend_check_relocs rl78_elf_check_relocs --#define elf_backend_always_size_sections \ -- rl78_elf_always_size_sections -+#define elf_backend_early_size_sections \ -+ rl78_elf_early_size_sections - #define elf_backend_finish_dynamic_sections \ - rl78_elf_finish_dynamic_sections - ---- a/bfd/elf32-s390.c -+++ b/bfd/elf32-s390.c -@@ -1366,7 +1366,7 @@ elf_s390_gc_mark_hook (asection *sec, - entry but we found we will not create any. Called when we find we will - not have any PLT for this symbol, by for example - elf_s390_adjust_dynamic_symbol when we're doing a proper dynamic link, -- or elf_s390_size_dynamic_sections if no dynamic sections will be -+ or elf_s390_late_size_sections if no dynamic sections will be - created (we're only linking static objects). */ - - static void -@@ -1778,8 +1778,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --elf_s390_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_s390_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_s390_link_hash_table *htab; - bfd *dynobj; -@@ -1790,7 +1790,7 @@ elf_s390_size_dynamic_sections (bfd *out - htab = elf_s390_hash_table (info); - dynobj = htab->elf.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - if (htab->elf.dynamic_sections_created) - { -@@ -3926,7 +3926,7 @@ elf32_s390_merge_private_bfd_data (bfd * - #define elf_backend_gc_mark_hook elf_s390_gc_mark_hook - #define elf_backend_reloc_type_class elf_s390_reloc_type_class - #define elf_backend_relocate_section elf_s390_relocate_section --#define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections -+#define elf_backend_late_size_sections elf_s390_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_grok_prstatus elf_s390_grok_prstatus - #define elf_backend_grok_psinfo elf_s390_grok_psinfo ---- a/bfd/elf32-score.c -+++ b/bfd/elf32-score.c -@@ -1089,7 +1089,7 @@ score_elf_got_info (bfd *abfd, asection - appear towards the end. This reduces the amount of GOT space - required. MAX_LOCAL is used to set the number of local symbols - known to be in the dynamic symbol table. During -- s3_bfd_score_elf_size_dynamic_sections, this value is 1. Afterward, the -+ s3_bfd_score_elf_late_size_sections, this value is 1. Afterward, the - section symbols are added and the count is higher. */ - static bool - score_elf_sort_hash_table (struct bfd_link_info *info, -@@ -3160,8 +3160,8 @@ s3_bfd_score_elf_adjust_dynamic_symbol ( - /* This function is called after all the input files have been read, - and the input sections have been assigned to output sections. */ - static bool --s3_bfd_score_elf_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+s3_bfd_score_elf_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; -@@ -3237,14 +3237,15 @@ s3_bfd_score_elf_always_size_sections (b - - /* Set the sizes of the dynamic sections. */ - static bool --s3_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+s3_bfd_score_elf_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; - bool reltext; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -3313,7 +3314,7 @@ s3_bfd_score_elf_size_dynamic_sections ( - } - else if (startswith (name, ".got")) - { -- /* s3_bfd_score_elf_always_size_sections() has already done -+ /* s3_bfd_score_elf_early_size_sections() has already done - most of the work, but some symbols may have been mapped - to versions that we must now resolve in the got_entries - hash tables. */ -@@ -4177,22 +4178,22 @@ _bfd_score_elf_adjust_dynamic_symbol (st - } - - static bool --_bfd_score_elf_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+_bfd_score_elf_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - if (bfd_get_mach (output_bfd) == bfd_mach_score3) -- return s3_bfd_score_elf_always_size_sections (output_bfd, info); -+ return s3_bfd_score_elf_early_size_sections (output_bfd, info); - else -- return s7_bfd_score_elf_always_size_sections (output_bfd, info); -+ return s7_bfd_score_elf_early_size_sections (output_bfd, info); - } - - static bool --_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+_bfd_score_elf_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - if (bfd_get_mach (output_bfd) == bfd_mach_score3) -- return s3_bfd_score_elf_size_dynamic_sections (output_bfd, info); -+ return s3_bfd_score_elf_late_size_sections (output_bfd, info); - else -- return s7_bfd_score_elf_size_dynamic_sections (output_bfd, info); -+ return s7_bfd_score_elf_late_size_sections (output_bfd, info); - } - - static bool -@@ -4455,10 +4456,10 @@ _bfd_score_elf_common_definition (Elf_In - _bfd_score_elf_section_from_bfd_section - #define elf_backend_adjust_dynamic_symbol \ - _bfd_score_elf_adjust_dynamic_symbol --#define elf_backend_always_size_sections \ -- _bfd_score_elf_always_size_sections --#define elf_backend_size_dynamic_sections \ -- _bfd_score_elf_size_dynamic_sections -+#define elf_backend_early_size_sections \ -+ _bfd_score_elf_early_size_sections -+#define elf_backend_late_size_sections \ -+ _bfd_score_elf_late_size_sections - #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all - #define elf_backend_create_dynamic_sections \ - _bfd_score_elf_create_dynamic_sections ---- a/bfd/elf32-score.h -+++ b/bfd/elf32-score.h -@@ -78,10 +78,10 @@ s7_bfd_score_elf_adjust_dynamic_symbol ( - struct elf_link_hash_entry *); - - extern bool --s7_bfd_score_elf_always_size_sections (bfd *, struct bfd_link_info *); -+s7_bfd_score_elf_early_size_sections (bfd *, struct bfd_link_info *); - - extern bool --s7_bfd_score_elf_size_dynamic_sections (bfd *, struct bfd_link_info *); -+s7_bfd_score_elf_late_size_sections (bfd *, struct bfd_link_info *); - - extern bool - s7_bfd_score_elf_create_dynamic_sections (bfd *, struct bfd_link_info *); ---- a/bfd/elf32-score7.c -+++ b/bfd/elf32-score7.c -@@ -975,7 +975,7 @@ score_elf_got_info (bfd *abfd, asection - appear towards the end. This reduces the amount of GOT space - required. MAX_LOCAL is used to set the number of local symbols - known to be in the dynamic symbol table. During -- s7_bfd_score_elf_size_dynamic_sections, this value is 1. Afterward, the -+ s7_bfd_score_elf_late_size_sections, this value is 1. Afterward, the - section symbols are added and the count is higher. */ - - static bool -@@ -2969,8 +2969,8 @@ s7_bfd_score_elf_adjust_dynamic_symbol ( - and the input sections have been assigned to output sections. */ - - bool --s7_bfd_score_elf_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+s7_bfd_score_elf_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; -@@ -3047,14 +3047,15 @@ s7_bfd_score_elf_always_size_sections (b - /* Set the sizes of the dynamic sections. */ - - bool --s7_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+s7_bfd_score_elf_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; - bool reltext; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -3123,7 +3124,7 @@ s7_bfd_score_elf_size_dynamic_sections ( - } - else if (startswith (name, ".got")) - { -- /* s7_bfd_score_elf_always_size_sections() has already done -+ /* s7_bfd_score_elf_early_size_sections() has already done - most of the work, but some symbols may have been mapped - to versions that we must now resolve in the got_entries - hash tables. */ ---- a/bfd/elf32-sh.c -+++ b/bfd/elf32-sh.c -@@ -2927,7 +2927,7 @@ allocate_dynrelocs (struct elf_link_hash - It's a convenient place to determine the PLT style. */ - - static bool --sh_elf_always_size_sections (bfd *output_bfd, struct bfd_link_info *info) -+sh_elf_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - sh_elf_hash_table (info)->plt_info = get_plt_info (output_bfd, - bfd_link_pic (info)); -@@ -2942,8 +2942,8 @@ sh_elf_always_size_sections (bfd *output - /* Set the sizes of the dynamic sections. */ - - static bool --sh_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+sh_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_sh_link_hash_table *htab; - bfd *dynobj; -@@ -2956,7 +2956,8 @@ sh_elf_size_dynamic_sections (bfd *outpu - return false; - - dynobj = htab->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->root.dynamic_sections_created) - { -@@ -6602,10 +6603,8 @@ sh_elf_encode_eh_address (bfd *abfd, - sh_elf_link_hash_table_create - #define elf_backend_adjust_dynamic_symbol \ - sh_elf_adjust_dynamic_symbol --#define elf_backend_always_size_sections \ -- sh_elf_always_size_sections --#define elf_backend_size_dynamic_sections \ -- sh_elf_size_dynamic_sections -+#define elf_backend_early_size_sections sh_elf_early_size_sections -+#define elf_backend_late_size_sections sh_elf_late_size_sections - #define elf_backend_omit_section_dynsym sh_elf_omit_section_dynsym - #define elf_backend_finish_dynamic_symbol \ - sh_elf_finish_dynamic_symbol ---- a/bfd/elf32-sparc.c -+++ b/bfd/elf32-sparc.c -@@ -248,8 +248,7 @@ elf32_sparc_reloc_type_class (const stru - #define elf_backend_adjust_dynamic_symbol \ - _bfd_sparc_elf_adjust_dynamic_symbol - #define elf_backend_omit_section_dynsym _bfd_sparc_elf_omit_section_dynsym --#define elf_backend_size_dynamic_sections \ -- _bfd_sparc_elf_size_dynamic_sections -+#define elf_backend_late_size_sections _bfd_sparc_elf_late_size_sections - #define elf_backend_relocate_section _bfd_sparc_elf_relocate_section - #define elf_backend_finish_dynamic_symbol \ - _bfd_sparc_elf_finish_dynamic_symbol ---- a/bfd/elf32-tic6x.c -+++ b/bfd/elf32-tic6x.c -@@ -3160,7 +3160,7 @@ elf32_tic6x_allocate_dynrelocs (struct e - /* Set the sizes of the dynamic sections. */ - - static bool --elf32_tic6x_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+elf32_tic6x_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - struct elf32_tic6x_link_hash_table *htab; - bfd *dynobj; -@@ -3171,7 +3171,7 @@ elf32_tic6x_size_dynamic_sections (bfd * - htab = elf32_tic6x_hash_table (info); - dynobj = htab->elf.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - if (htab->elf.dynamic_sections_created) - { -@@ -3358,7 +3358,7 @@ elf32_tic6x_size_dynamic_sections (bfd * - and the input sections have been assigned to output sections. */ - - static bool --elf32_tic6x_always_size_sections (bfd *output_bfd, struct bfd_link_info *info) -+elf32_tic6x_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - if (elf32_tic6x_using_dsbt (output_bfd) && !bfd_link_relocatable (info) - && !bfd_elf_stack_segment_size (output_bfd, info, -@@ -4261,10 +4261,10 @@ elf32_tic6x_write_section (bfd *output_b - #define elf_backend_relocs_compatible _bfd_elf_relocs_compatible - #define elf_backend_finish_dynamic_symbol \ - elf32_tic6x_finish_dynamic_symbol --#define elf_backend_always_size_sections \ -- elf32_tic6x_always_size_sections --#define elf_backend_size_dynamic_sections \ -- elf32_tic6x_size_dynamic_sections -+#define elf_backend_early_size_sections \ -+ elf32_tic6x_early_size_sections -+#define elf_backend_late_size_sections \ -+ elf32_tic6x_late_size_sections - #define elf_backend_finish_dynamic_sections \ - elf32_tic6x_finish_dynamic_sections - #define bfd_elf32_bfd_final_link \ ---- a/bfd/elf32-tilegx.c -+++ b/bfd/elf32-tilegx.c -@@ -105,7 +105,7 @@ tilegx_elf_grok_psinfo (bfd *abfd, Elf_I - #define elf_backend_check_relocs tilegx_elf_check_relocs - #define elf_backend_adjust_dynamic_symbol tilegx_elf_adjust_dynamic_symbol - #define elf_backend_omit_section_dynsym tilegx_elf_omit_section_dynsym --#define elf_backend_size_dynamic_sections tilegx_elf_size_dynamic_sections -+#define elf_backend_late_size_sections tilegx_elf_late_size_sections - #define elf_backend_relocate_section tilegx_elf_relocate_section - #define elf_backend_finish_dynamic_symbol tilegx_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections tilegx_elf_finish_dynamic_sections ---- a/bfd/elf32-tilepro.c -+++ b/bfd/elf32-tilepro.c -@@ -2182,11 +2182,9 @@ tilepro_elf_omit_section_dynsym (bfd *ou - #define ELF32_DYNAMIC_INTERPRETER "/lib/ld.so.1" - - static bool --tilepro_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+tilepro_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { -- (void)output_bfd; -- - struct elf_link_hash_table *htab; - bfd *dynobj; - asection *s; -@@ -2195,7 +2193,8 @@ tilepro_elf_size_dynamic_sections (bfd * - htab = tilepro_elf_hash_table (info); - BFD_ASSERT (htab != NULL); - dynobj = htab->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -3739,7 +3738,7 @@ tilepro_additional_program_headers (bfd - #define elf_backend_check_relocs tilepro_elf_check_relocs - #define elf_backend_adjust_dynamic_symbol tilepro_elf_adjust_dynamic_symbol - #define elf_backend_omit_section_dynsym tilepro_elf_omit_section_dynsym --#define elf_backend_size_dynamic_sections tilepro_elf_size_dynamic_sections -+#define elf_backend_late_size_sections tilepro_elf_late_size_sections - #define elf_backend_relocate_section tilepro_elf_relocate_section - #define elf_backend_finish_dynamic_symbol tilepro_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections tilepro_elf_finish_dynamic_sections ---- a/bfd/elf32-vax.c -+++ b/bfd/elf32-vax.c -@@ -36,7 +36,6 @@ static bool elf_vax_check_relocs (bfd *, - asection *, const Elf_Internal_Rela *); - static bool elf_vax_adjust_dynamic_symbol (struct bfd_link_info *, - struct elf_link_hash_entry *); --static bool elf_vax_size_dynamic_sections (bfd *, struct bfd_link_info *); - static int elf_vax_relocate_section (bfd *, struct bfd_link_info *, - bfd *, asection *, bfd_byte *, - Elf_Internal_Rela *, -@@ -985,8 +984,8 @@ elf_vax_discard_got_entries (struct elf_ - /* Discard unused dynamic data if this is a static link. */ - - static bool --elf_vax_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_vax_early_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; -@@ -1024,14 +1023,15 @@ elf_vax_always_size_sections (bfd *outpu - /* Set the sizes of the dynamic sections. */ - - static bool --elf_vax_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+elf_vax_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; - bool relocs; - - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -1861,10 +1861,8 @@ elf_vax_plt_sym_val (bfd_vma i, const as - #define elf_backend_check_relocs elf_vax_check_relocs - #define elf_backend_adjust_dynamic_symbol \ - elf_vax_adjust_dynamic_symbol --#define elf_backend_always_size_sections \ -- elf_vax_always_size_sections --#define elf_backend_size_dynamic_sections \ -- elf_vax_size_dynamic_sections -+#define elf_backend_early_size_sections elf_vax_early_size_sections -+#define elf_backend_late_size_sections elf_vax_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section elf_vax_relocate_section - #define elf_backend_finish_dynamic_symbol \ ---- a/bfd/elf32-xstormy16.c -+++ b/bfd/elf32-xstormy16.c -@@ -706,8 +706,8 @@ xstormy16_elf_relax_section (bfd *dynobj - } - - static bool --xstormy16_elf_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+xstormy16_elf_early_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *splt; -@@ -1013,8 +1013,8 @@ xstormy16_elf_gc_mark_hook (asection *se - #define elf_backend_relocate_section xstormy16_elf_relocate_section - #define elf_backend_gc_mark_hook xstormy16_elf_gc_mark_hook - #define elf_backend_check_relocs xstormy16_elf_check_relocs --#define elf_backend_always_size_sections \ -- xstormy16_elf_always_size_sections -+#define elf_backend_early_size_sections \ -+ xstormy16_elf_early_size_sections - #define elf_backend_omit_section_dynsym \ - _bfd_elf_omit_section_dynsym_all - #define elf_backend_finish_dynamic_sections \ ---- a/bfd/elf32-xtensa.c -+++ b/bfd/elf32-xtensa.c -@@ -1557,8 +1557,8 @@ elf_xtensa_allocate_local_got_size (stru - /* Set the sizes of the dynamic sections. */ - - static bool --elf_xtensa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_xtensa_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_xtensa_link_hash_table *htab; - bfd *dynobj, *abfd; -@@ -1575,7 +1575,7 @@ elf_xtensa_size_dynamic_sections (bfd *o - - dynobj = elf_hash_table (info)->dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - srelgot = htab->elf.srelgot; - srelplt = htab->elf.srelplt; - -@@ -1780,8 +1780,7 @@ elf_xtensa_size_dynamic_sections (bfd *o - } - - static bool --elf_xtensa_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf_xtensa_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - struct elf_xtensa_link_hash_table *htab; - asection *tls_sec; -@@ -11544,8 +11543,8 @@ static const struct bfd_elf_special_sect - #define elf_backend_object_p elf_xtensa_object_p - #define elf_backend_reloc_type_class elf_xtensa_reloc_type_class - #define elf_backend_relocate_section elf_xtensa_relocate_section --#define elf_backend_size_dynamic_sections elf_xtensa_size_dynamic_sections --#define elf_backend_always_size_sections elf_xtensa_always_size_sections -+#define elf_backend_late_size_sections elf_xtensa_late_size_sections -+#define elf_backend_early_size_sections elf_xtensa_early_size_sections - #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all - #define elf_backend_special_sections elf_xtensa_special_sections - #define elf_backend_action_discarded elf_xtensa_action_discarded ---- a/bfd/elf64-alpha.c -+++ b/bfd/elf64-alpha.c -@@ -2562,8 +2562,8 @@ elf64_alpha_size_plt_section (struct bfd - } - - static bool --elf64_alpha_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf64_alpha_early_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *i; - struct alpha_elf_link_hash_table * htab; -@@ -2789,8 +2789,8 @@ elf64_alpha_size_rela_got_section (struc - /* Set the sizes of the dynamic sections. */ - - static bool --elf64_alpha_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf64_alpha_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s; -@@ -2802,7 +2802,8 @@ elf64_alpha_size_dynamic_sections (bfd * - return false; - - dynobj = elf_hash_table(info)->dynobj; -- BFD_ASSERT(dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -5448,10 +5449,10 @@ static const struct elf_size_info alpha_ - elf64_alpha_merge_symbol_attribute - #define elf_backend_copy_indirect_symbol \ - elf64_alpha_copy_indirect_symbol --#define elf_backend_always_size_sections \ -- elf64_alpha_always_size_sections --#define elf_backend_size_dynamic_sections \ -- elf64_alpha_size_dynamic_sections -+#define elf_backend_early_size_sections \ -+ elf64_alpha_early_size_sections -+#define elf_backend_late_size_sections \ -+ elf64_alpha_late_size_sections - #define elf_backend_omit_section_dynsym \ - _bfd_elf_omit_section_dynsym_all - #define elf_backend_relocate_section \ ---- a/bfd/elf64-hppa.c -+++ b/bfd/elf64-hppa.c -@@ -176,9 +176,6 @@ static bool elf64_hppa_adjust_dynamic_sy - static bool elf64_hppa_mark_milli_and_exported_functions - (struct elf_link_hash_entry *, void *); - --static bool elf64_hppa_size_dynamic_sections -- (bfd *, struct bfd_link_info *); -- - static int elf64_hppa_link_output_symbol_hook - (struct bfd_link_info *, const char *, Elf_Internal_Sym *, - asection *, struct elf_link_hash_entry *); -@@ -1520,7 +1517,7 @@ elf64_hppa_mark_milli_and_exported_funct - the contents of our special sections. */ - - static bool --elf64_hppa_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+elf64_hppa_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - struct elf64_hppa_link_hash_table *hppa_info; - struct elf64_hppa_allocate_data data; -@@ -1534,7 +1531,8 @@ elf64_hppa_size_dynamic_sections (bfd *o - return false; - - dynobj = hppa_info->root.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - /* Mark each function this program exports so that we will allocate - space in the .opd section for each function's FPTR. If we are -@@ -3984,8 +3982,7 @@ const struct elf_size_info hppa64_elf_si - #define elf_backend_adjust_dynamic_symbol \ - elf64_hppa_adjust_dynamic_symbol - --#define elf_backend_size_dynamic_sections \ -- elf64_hppa_size_dynamic_sections -+#define elf_backend_late_size_sections elf64_hppa_late_size_sections - - #define elf_backend_finish_dynamic_symbol \ - elf64_hppa_finish_dynamic_symbol ---- a/bfd/elf64-ia64-vms.c -+++ b/bfd/elf64-ia64-vms.c -@@ -2591,8 +2591,8 @@ elf64_ia64_adjust_dynamic_symbol (struct - } - - static bool --elf64_ia64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf64_ia64_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf64_ia64_allocate_data data; - struct elf64_ia64_link_hash_table *ia64_info; -@@ -2601,11 +2601,12 @@ elf64_ia64_size_dynamic_sections (bfd *o - struct elf_link_hash_table *hash_table; - - hash_table = elf_hash_table (info); -- dynobj = hash_table->dynobj; - ia64_info = elf64_ia64_hash_table (info); - if (ia64_info == NULL) - return false; -- BFD_ASSERT(dynobj != NULL); -+ dynobj = hash_table->dynobj; -+ if (dynobj == NULL) -+ return true; - data.info = info; - - /* Allocate the GOT entries. */ -@@ -5485,8 +5486,8 @@ static const struct elf_size_info elf64_ - elf64_ia64_check_relocs - #define elf_backend_adjust_dynamic_symbol \ - elf64_ia64_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections \ -- elf64_ia64_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ elf64_ia64_late_size_sections - #define elf_backend_omit_section_dynsym \ - _bfd_elf_omit_section_dynsym_all - #define elf_backend_relocate_section \ ---- a/bfd/elf64-mips.c -+++ b/bfd/elf64-mips.c -@@ -4748,10 +4748,10 @@ const struct elf_size_info mips_elf64_si - #define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mips_elf_adjust_dynamic_symbol --#define elf_backend_always_size_sections \ -- _bfd_mips_elf_always_size_sections --#define elf_backend_size_dynamic_sections \ -- _bfd_mips_elf_size_dynamic_sections -+#define elf_backend_early_size_sections \ -+ _bfd_mips_elf_early_size_sections -+#define elf_backend_late_size_sections \ -+ _bfd_mips_elf_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section _bfd_mips_elf_relocate_section - #define elf_backend_finish_dynamic_symbol \ ---- a/bfd/elf64-ppc.c -+++ b/bfd/elf64-ppc.c -@@ -119,8 +119,8 @@ static bfd_vma opd_entry_value - #define elf_backend_adjust_dynamic_symbol ppc64_elf_adjust_dynamic_symbol - #define elf_backend_hide_symbol ppc64_elf_hide_symbol - #define elf_backend_maybe_function_sym ppc64_elf_maybe_function_sym --#define elf_backend_always_size_sections ppc64_elf_edit --#define elf_backend_size_dynamic_sections ppc64_elf_size_dynamic_sections -+#define elf_backend_early_size_sections ppc64_elf_edit -+#define elf_backend_late_size_sections ppc64_elf_late_size_sections - #define elf_backend_hash_symbol ppc64_elf_hash_symbol - #define elf_backend_init_index_section _bfd_elf_init_2_index_sections - #define elf_backend_action_discarded ppc64_elf_action_discarded -@@ -10138,7 +10138,7 @@ allocate_dynrelocs (struct elf_link_hash - ((((v) & 0x3ffff0000ULL) << 16) | (v & 0xffff)) - #define HA34(v) ((v + (1ULL << 33)) >> 34) - --/* Called via elf_link_hash_traverse from ppc64_elf_size_dynamic_sections -+/* Called via elf_link_hash_traverse from ppc64_elf_late_size_sections - to set up space for global entry stubs. These are put in glink, - after the branch table. */ - -@@ -10215,8 +10215,8 @@ size_global_entry_stubs (struct elf_link - /* Set the sizes of the dynamic sections. */ - - static bool --ppc64_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+ppc64_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - struct ppc_link_hash_table *htab; - bfd *dynobj; -@@ -10231,7 +10231,7 @@ ppc64_elf_size_dynamic_sections (bfd *ou - - dynobj = htab->elf.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - if (htab->elf.dynamic_sections_created) - { ---- a/bfd/elf64-s390.c -+++ b/bfd/elf64-s390.c -@@ -1301,7 +1301,7 @@ elf_s390_gc_mark_hook (asection *sec, - entry but we found we will not create any. Called when we find we will - not have any PLT for this symbol, by for example - elf_s390_adjust_dynamic_symbol when we're doing a proper dynamic link, -- or elf_s390_size_dynamic_sections if no dynamic sections will be -+ or elf_s390_late_size_sections if no dynamic sections will be - created (we're only linking static objects). */ - - static void -@@ -1714,8 +1714,8 @@ allocate_dynrelocs (struct elf_link_hash - /* Set the sizes of the dynamic sections. */ - - static bool --elf_s390_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elf_s390_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_s390_link_hash_table *htab; - bfd *dynobj; -@@ -1729,7 +1729,7 @@ elf_s390_size_dynamic_sections (bfd *out - - dynobj = htab->elf.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - if (htab->elf.dynamic_sections_created) - { -@@ -3912,7 +3912,7 @@ const struct elf_size_info s390_elf64_si - #define elf_backend_gc_mark_hook elf_s390_gc_mark_hook - #define elf_backend_reloc_type_class elf_s390_reloc_type_class - #define elf_backend_relocate_section elf_s390_relocate_section --#define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections -+#define elf_backend_late_size_sections elf_s390_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_grok_prstatus elf_s390_grok_prstatus - #define elf_backend_grok_psinfo elf_s390_grok_psinfo ---- a/bfd/elf64-sparc.c -+++ b/bfd/elf64-sparc.c -@@ -953,8 +953,8 @@ const struct elf_size_info elf64_sparc_s - _bfd_sparc_elf_adjust_dynamic_symbol - #define elf_backend_omit_section_dynsym \ - _bfd_sparc_elf_omit_section_dynsym --#define elf_backend_size_dynamic_sections \ -- _bfd_sparc_elf_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ _bfd_sparc_elf_late_size_sections - #define elf_backend_relocate_section \ - _bfd_sparc_elf_relocate_section - #define elf_backend_finish_dynamic_symbol \ ---- a/bfd/elf64-tilegx.c -+++ b/bfd/elf64-tilegx.c -@@ -106,7 +106,7 @@ tilegx_elf_grok_psinfo (bfd *abfd, Elf_I - #define elf_backend_check_relocs tilegx_elf_check_relocs - #define elf_backend_adjust_dynamic_symbol tilegx_elf_adjust_dynamic_symbol - #define elf_backend_omit_section_dynsym tilegx_elf_omit_section_dynsym --#define elf_backend_size_dynamic_sections tilegx_elf_size_dynamic_sections -+#define elf_backend_late_size_sections tilegx_elf_late_size_sections - #define elf_backend_relocate_section tilegx_elf_relocate_section - #define elf_backend_finish_dynamic_symbol tilegx_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections tilegx_elf_finish_dynamic_sections ---- a/bfd/elf64-x86-64.c -+++ b/bfd/elf64-x86-64.c -@@ -2468,8 +2468,7 @@ elf_x86_64_scan_relocs (bfd *abfd, struc - } - - static bool --elf_x86_64_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elf_x86_64_early_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - bfd *abfd; - -@@ -2482,7 +2481,7 @@ elf_x86_64_always_size_sections (bfd *ou - elf_x86_64_scan_relocs)) - return false; - -- return _bfd_x86_elf_always_size_sections (output_bfd, info); -+ return _bfd_x86_elf_early_size_sections (output_bfd, info); - } - - /* Return the relocation value for @tpoff relocation -@@ -5413,7 +5412,7 @@ elf_x86_64_special_sections[]= - elf_x86_64_reloc_name_lookup - - #define elf_backend_relocs_compatible elf_x86_64_relocs_compatible --#define elf_backend_always_size_sections elf_x86_64_always_size_sections -+#define elf_backend_early_size_sections elf_x86_64_early_size_sections - #define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections - #define elf_backend_finish_dynamic_sections elf_x86_64_finish_dynamic_sections - #define elf_backend_finish_dynamic_symbol elf_x86_64_finish_dynamic_symbol ---- a/bfd/elflink.c -+++ b/bfd/elflink.c -@@ -6648,8 +6648,8 @@ bfd_elf_size_dynamic_sections (bfd *outp - - /* The backend may have to create some sections regardless of whether - we're dynamic or not. */ -- if (bed->elf_backend_always_size_sections -- && ! (*bed->elf_backend_always_size_sections) (output_bfd, info)) -+ if (bed->elf_backend_early_size_sections -+ && !bed->elf_backend_early_size_sections (output_bfd, info)) - return false; - - dynobj = elf_hash_table (info)->dynobj; -@@ -7429,9 +7429,8 @@ NOTE: This behaviour is deprecated and w - - /* The backend must work out the sizes of all the other dynamic - sections. */ -- if (dynobj != NULL -- && bed->elf_backend_size_dynamic_sections != NULL -- && ! (*bed->elf_backend_size_dynamic_sections) (output_bfd, info)) -+ if (bed->elf_backend_late_size_sections != NULL -+ && !bed->elf_backend_late_size_sections (output_bfd, info)) - return false; - - if (dynobj != NULL && elf_hash_table (info)->dynamic_sections_created) ---- a/bfd/elfn32-mips.c -+++ b/bfd/elfn32-mips.c -@@ -4138,10 +4138,8 @@ static const struct ecoff_debug_swap mip - #define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mips_elf_adjust_dynamic_symbol --#define elf_backend_always_size_sections \ -- _bfd_mips_elf_always_size_sections --#define elf_backend_size_dynamic_sections \ -- _bfd_mips_elf_size_dynamic_sections -+#define elf_backend_early_size_sections _bfd_mips_elf_early_size_sections -+#define elf_backend_late_size_sections _bfd_mips_elf_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section _bfd_mips_elf_relocate_section - #define elf_backend_finish_dynamic_symbol \ ---- a/bfd/elfnn-aarch64.c -+++ b/bfd/elfnn-aarch64.c -@@ -112,7 +112,7 @@ - allocate space for one relocation on the slot. Record the GOT offset - for this symbol. - -- elfNN_aarch64_size_dynamic_sections () -+ elfNN_aarch64_late_size_sections () - - Iterate all input BFDS, look for in the local symbol data structure - constructed earlier for local TLS symbols and allocate them double -@@ -9144,8 +9144,8 @@ elfNN_aarch64_allocate_local_ifunc_dynre - though ! */ - - static bool --elfNN_aarch64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elfNN_aarch64_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elf_aarch64_link_hash_table *htab; - bfd *dynobj; -@@ -9156,7 +9156,8 @@ elfNN_aarch64_size_dynamic_sections (bfd - htab = elf_aarch64_hash_table ((info)); - dynobj = htab->root.dynobj; - -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->root.dynamic_sections_created) - { -@@ -9558,8 +9559,8 @@ elfNN_aarch64_create_small_pltn_entry (s - _TLS_MODULE_BASE_, if needed. */ - - static bool --elfNN_aarch64_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+elfNN_aarch64_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - asection *tls_sec; - -@@ -10292,8 +10293,8 @@ const struct elf_size_info elfNN_aarch64 - #define elf_backend_adjust_dynamic_symbol \ - elfNN_aarch64_adjust_dynamic_symbol - --#define elf_backend_always_size_sections \ -- elfNN_aarch64_always_size_sections -+#define elf_backend_early_size_sections \ -+ elfNN_aarch64_early_size_sections - - #define elf_backend_check_relocs \ - elfNN_aarch64_check_relocs -@@ -10348,8 +10349,8 @@ const struct elf_size_info elfNN_aarch64 - #define elf_backend_modify_headers \ - elfNN_aarch64_modify_headers - --#define elf_backend_size_dynamic_sections \ -- elfNN_aarch64_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ elfNN_aarch64_late_size_sections - - #define elf_backend_size_info \ - elfNN_aarch64_size_info ---- a/bfd/elfnn-ia64.c -+++ b/bfd/elfnn-ia64.c -@@ -2987,8 +2987,8 @@ elfNN_ia64_adjust_dynamic_symbol (struct - } - - static bool --elfNN_ia64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+elfNN_ia64_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct elfNN_ia64_allocate_data data; - struct elfNN_ia64_link_hash_table *ia64_info; -@@ -2999,8 +2999,9 @@ elfNN_ia64_size_dynamic_sections (bfd *o - if (ia64_info == NULL) - return false; - dynobj = ia64_info->root.dynobj; -+ if (dynobj == NULL) -+ return true; - ia64_info->self_dtpmod_offset = (bfd_vma) -1; -- BFD_ASSERT(dynobj != NULL); - data.info = info; - - /* Set the contents of the .interp section to the interpreter. */ -@@ -5036,8 +5037,8 @@ ignore_errors (const char *fmt ATTRIBUTE - elfNN_ia64_check_relocs - #define elf_backend_adjust_dynamic_symbol \ - elfNN_ia64_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections \ -- elfNN_ia64_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ elfNN_ia64_late_size_sections - #define elf_backend_omit_section_dynsym \ - _bfd_elf_omit_section_dynsym_all - #define elf_backend_relocate_section \ ---- a/bfd/elfnn-loongarch.c -+++ b/bfd/elfnn-loongarch.c -@@ -1581,8 +1581,8 @@ maybe_set_textrel (struct elf_link_hash_ - } - - static bool --loongarch_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+loongarch_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - struct loongarch_elf_link_hash_table *htab; - bfd *dynobj; -@@ -1592,7 +1592,8 @@ loongarch_elf_size_dynamic_sections (bfd - htab = loongarch_elf_hash_table (info); - BFD_ASSERT (htab != NULL); - dynobj = htab->elf.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (htab->elf.dynamic_sections_created) - { -@@ -4651,7 +4652,7 @@ elf_loongarch64_hash_symbol (struct elf_ - loongarch_elf_create_dynamic_sections - #define elf_backend_check_relocs loongarch_elf_check_relocs - #define elf_backend_adjust_dynamic_symbol loongarch_elf_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections loongarch_elf_size_dynamic_sections -+#define elf_backend_late_size_sections loongarch_elf_late_size_sections - #define elf_backend_relocate_section loongarch_elf_relocate_section - #define elf_backend_finish_dynamic_symbol loongarch_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections \ ---- a/bfd/elfnn-riscv.c -+++ b/bfd/elfnn-riscv.c -@@ -1485,7 +1485,7 @@ allocate_local_ifunc_dynrelocs (void **s - } - - static bool --riscv_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+riscv_elf_late_size_sections (bfd *output_bfd, struct bfd_link_info *info) - { - struct riscv_elf_link_hash_table *htab; - bfd *dynobj; -@@ -1495,7 +1495,8 @@ riscv_elf_size_dynamic_sections (bfd *ou - htab = riscv_elf_hash_table (info); - BFD_ASSERT (htab != NULL); - dynobj = htab->elf.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -5540,7 +5541,7 @@ riscv_elf_merge_symbol_attribute (struct - #define elf_backend_create_dynamic_sections riscv_elf_create_dynamic_sections - #define elf_backend_check_relocs riscv_elf_check_relocs - #define elf_backend_adjust_dynamic_symbol riscv_elf_adjust_dynamic_symbol --#define elf_backend_size_dynamic_sections riscv_elf_size_dynamic_sections -+#define elf_backend_late_size_sections riscv_elf_late_size_sections - #define elf_backend_relocate_section riscv_elf_relocate_section - #define elf_backend_finish_dynamic_symbol riscv_elf_finish_dynamic_symbol - #define elf_backend_finish_dynamic_sections riscv_elf_finish_dynamic_sections ---- a/bfd/elfxx-mips.c -+++ b/bfd/elfxx-mips.c -@@ -9644,8 +9644,8 @@ _bfd_mips_elf_adjust_dynamic_symbol (str - check for any mips16 stub sections that we can discard. */ - - bool --_bfd_mips_elf_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+_bfd_mips_elf_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - asection *sect; - struct mips_elf_link_hash_table *htab; -@@ -9988,8 +9988,8 @@ mips_elf_set_plt_sym_value (struct mips_ - /* Set the sizes of the dynamic sections. */ - - bool --_bfd_mips_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+_bfd_mips_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - bfd *dynobj; - asection *s, *sreldyn; -@@ -9999,7 +9999,8 @@ _bfd_mips_elf_size_dynamic_sections (bfd - htab = mips_elf_hash_table (info); - BFD_ASSERT (htab != NULL); - dynobj = elf_hash_table (info)->dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { -@@ -14933,7 +14934,7 @@ _bfd_mips_elf_final_link (bfd *abfd, str - input_section->flags &= ~SEC_HAS_CONTENTS; - } - -- /* Size has been set in _bfd_mips_elf_always_size_sections. */ -+ /* Size has been set in _bfd_mips_elf_early_size_sections. */ - BFD_ASSERT(o->size == sizeof (Elf_External_ABIFlags_v0)); - - /* Skip this section later on (I don't think this currently -@@ -14992,7 +14993,7 @@ _bfd_mips_elf_final_link (bfd *abfd, str - input_section->flags &= ~SEC_HAS_CONTENTS; - } - -- /* Size has been set in _bfd_mips_elf_always_size_sections. */ -+ /* Size has been set in _bfd_mips_elf_early_size_sections. */ - BFD_ASSERT(o->size == sizeof (Elf32_External_RegInfo)); - - /* Skip this section later on (I don't think this currently ---- a/bfd/elfxx-mips.h -+++ b/bfd/elfxx-mips.h -@@ -67,9 +67,9 @@ extern bool _bfd_mips_elf_check_relocs - (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *); - extern bool _bfd_mips_elf_adjust_dynamic_symbol - (struct bfd_link_info *, struct elf_link_hash_entry *); --extern bool _bfd_mips_elf_always_size_sections -+extern bool _bfd_mips_elf_early_size_sections - (bfd *, struct bfd_link_info *); --extern bool _bfd_mips_elf_size_dynamic_sections -+extern bool _bfd_mips_elf_late_size_sections - (bfd *, struct bfd_link_info *); - extern int _bfd_mips_elf_relocate_section - (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, ---- a/bfd/elfxx-sparc.c -+++ b/bfd/elfxx-sparc.c -@@ -2381,8 +2381,8 @@ _bfd_sparc_elf_omit_section_dynsym (bfd - /* Set the sizes of the dynamic sections. */ - - bool --_bfd_sparc_elf_size_dynamic_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+_bfd_sparc_elf_late_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - struct _bfd_sparc_elf_link_hash_table *htab; - bfd *dynobj; -@@ -2392,7 +2392,8 @@ _bfd_sparc_elf_size_dynamic_sections (bf - htab = _bfd_sparc_elf_hash_table (info); - BFD_ASSERT (htab != NULL); - dynobj = htab->elf.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { ---- a/bfd/elfxx-sparc.h -+++ b/bfd/elfxx-sparc.h -@@ -117,7 +117,7 @@ extern bool _bfd_sparc_elf_adjust_dynami - (struct bfd_link_info *, struct elf_link_hash_entry *); - extern bool _bfd_sparc_elf_omit_section_dynsym - (bfd *, struct bfd_link_info *, asection *); --extern bool _bfd_sparc_elf_size_dynamic_sections -+extern bool _bfd_sparc_elf_late_size_sections - (bfd *, struct bfd_link_info *); - extern bool _bfd_sparc_elf_new_section_hook - (bfd *, asection *); ---- a/bfd/elfxx-target.h -+++ b/bfd/elfxx-target.h -@@ -487,11 +487,11 @@ - #ifndef elf_backend_adjust_dynamic_symbol - #define elf_backend_adjust_dynamic_symbol 0 - #endif --#ifndef elf_backend_always_size_sections --#define elf_backend_always_size_sections 0 -+#ifndef elf_backend_early_size_sections -+#define elf_backend_early_size_sections 0 - #endif --#ifndef elf_backend_size_dynamic_sections --#define elf_backend_size_dynamic_sections 0 -+#ifndef elf_backend_late_size_sections -+#define elf_backend_late_size_sections 0 - #endif - #ifndef elf_backend_strip_zero_sized_dynamic_sections - #define elf_backend_strip_zero_sized_dynamic_sections 0 -@@ -849,8 +849,8 @@ static const struct elf_backend_data elf - elf_backend_check_directives, - elf_backend_notice_as_needed, - elf_backend_adjust_dynamic_symbol, -- elf_backend_always_size_sections, -- elf_backend_size_dynamic_sections, -+ elf_backend_early_size_sections, -+ elf_backend_late_size_sections, - elf_backend_strip_zero_sized_dynamic_sections, - elf_backend_init_index_section, - elf_backend_relocate_section, ---- a/bfd/elfxx-tilegx.c -+++ b/bfd/elfxx-tilegx.c -@@ -2430,8 +2430,8 @@ tilegx_elf_omit_section_dynsym (bfd *out - } - - bool --tilegx_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info) -+tilegx_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) - { - struct tilegx_elf_link_hash_table *htab; - bfd *dynobj; -@@ -2441,7 +2441,8 @@ tilegx_elf_size_dynamic_sections (bfd *o - htab = tilegx_elf_hash_table (info); - BFD_ASSERT (htab != NULL); - dynobj = htab->elf.dynobj; -- BFD_ASSERT (dynobj != NULL); -+ if (dynobj == NULL) -+ return true; - - if (elf_hash_table (info)->dynamic_sections_created) - { ---- a/bfd/elfxx-tilegx.h -+++ b/bfd/elfxx-tilegx.h -@@ -57,7 +57,7 @@ tilegx_elf_omit_section_dynsym (bfd *, - asection *); - - extern bool --tilegx_elf_size_dynamic_sections (bfd *, struct bfd_link_info *); -+tilegx_elf_late_size_sections (bfd *, struct bfd_link_info *); - - extern int - tilegx_elf_relocate_section (bfd *, struct bfd_link_info *, ---- a/bfd/elfxx-x86.c -+++ b/bfd/elfxx-x86.c -@@ -2241,7 +2241,7 @@ _bfd_elf_x86_valid_reloc_p (asection *in - /* Set the sizes of the dynamic sections. */ - - bool --_bfd_x86_elf_size_dynamic_sections (bfd *output_bfd, -+_bfd_x86_elf_late_size_sections (bfd *output_bfd, - struct bfd_link_info *info) - { - struct elf_x86_link_hash_table *htab; -@@ -2257,7 +2257,7 @@ _bfd_x86_elf_size_dynamic_sections (bfd - return false; - dynobj = htab->elf.dynobj; - if (dynobj == NULL) -- abort (); -+ return true; - - /* Set up .got offsets for local syms, and space for local dynamic - relocs. */ -@@ -2964,8 +2964,8 @@ _bfd_x86_elf_finish_dynamic_sections (bf - - - bool --_bfd_x86_elf_always_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) -+_bfd_x86_elf_early_size_sections (bfd *output_bfd, -+ struct bfd_link_info *info) - { - asection *tls_sec = elf_hash_table (info)->tls_sec; - ---- a/bfd/elfxx-x86.h -+++ b/bfd/elfxx-x86.h -@@ -847,13 +847,13 @@ extern bool _bfd_elf_x86_valid_reloc_p - const Elf_Internal_Rela *, struct elf_link_hash_entry *, - Elf_Internal_Sym *, Elf_Internal_Shdr *, bool *); - --extern bool _bfd_x86_elf_size_dynamic_sections -+extern bool _bfd_x86_elf_late_size_sections - (bfd *, struct bfd_link_info *); - - extern struct elf_x86_link_hash_table *_bfd_x86_elf_finish_dynamic_sections - (bfd *, struct bfd_link_info *); - --extern bool _bfd_x86_elf_always_size_sections -+extern bool _bfd_x86_elf_early_size_sections - (bfd *, struct bfd_link_info *); - - extern void _bfd_x86_elf_merge_symbol_attribute -@@ -925,8 +925,8 @@ extern void _bfd_x86_elf_link_report_rel - - #define elf_backend_check_relocs \ - _bfd_x86_elf_check_relocs --#define elf_backend_size_dynamic_sections \ -- _bfd_x86_elf_size_dynamic_sections -+#define elf_backend_late_size_sections \ -+ _bfd_x86_elf_late_size_sections - #define elf_backend_merge_symbol_attribute \ - _bfd_x86_elf_merge_symbol_attribute - #define elf_backend_copy_indirect_symbol \ ---- a/ld/emultempl/vms.em -+++ b/ld/emultempl/vms.em -@@ -196,10 +196,9 @@ gld${EMULATION_NAME}_before_allocation ( - - /* The backend must work out the sizes of all the other dynamic - sections. */ -- if (elf_hash_table (&link_info)->dynamic_sections_created -- && bed->elf_backend_size_dynamic_sections -- && ! (*bed->elf_backend_size_dynamic_sections) (link_info.output_bfd, -- &link_info)) -+ if (bed->elf_backend_late_size_sections -+ && !bed->elf_backend_late_size_sections (link_info.output_bfd, -+ &link_info)) - einfo (_("%F%P: failed to set dynamic section sizes: %E\n")); - - before_allocation_default (); diff --git a/toolchain/binutils/patches/2.41/002-PR-30569-delete-_bfd_mips_elf_early_size_sections.patch b/toolchain/binutils/patches/2.41/002-PR-30569-delete-_bfd_mips_elf_early_size_sections.patch deleted file mode 100644 index 6d47db5f2e..0000000000 --- a/toolchain/binutils/patches/2.41/002-PR-30569-delete-_bfd_mips_elf_early_size_sections.patch +++ /dev/null @@ -1,218 +0,0 @@ -From 3c6c32951e292a51ede70b8087bb0308d7dbc4fc Mon Sep 17 00:00:00 2001 -From: Alan Modra <amodra@gmail.com> -Date: Thu, 28 Mar 2024 20:33:32 +1030 -Subject: [PATCH 2/2] PR 30569, delete _bfd_mips_elf_early_size_sections - -PR30569 was triggered by a patch of mine 6540edd52cc0 moving the call -to always_size_sections in bfd_elf_size_dynamic_sections earlier, made -to support the x86 DT_RELR implementation. This broke mips16 code -handling stubs when --export-dynamic is passed to the linker, because -numerous symbols then became dynamic after always_size_sections. The -mips backend fiddles with symbols in its always_size_sections. Maciej -in 902e9fc76a0e had moved the call to always_size_sections to after -the export-dynamic code. Prior to that, Nathan in 04c3a75556c0 moved -it before the exec stack code, back to the start of -bfd_elf_size_dynamic_sections which was where Ian put it originally -in ff12f303355b. So the call has moved around a little. I'm leaving -it where it is, and instead calling mips_elf_check_symbols from -late_size_sections (the old size_dynamic_sections) which is now always -called. In fact, the whole of _bfd_mips_elf_early_size_sections can -be merged into _bfd_mips_elf_late_size_sections. ---- - bfd/elf32-mips.c | 1 - - bfd/elf64-mips.c | 2 -- - bfd/elfn32-mips.c | 1 - - bfd/elfxx-mips.c | 84 +++++++++++++++++++---------------------------- - bfd/elfxx-mips.h | 2 -- - 5 files changed, 34 insertions(+), 56 deletions(-) - ---- a/bfd/elf32-mips.c -+++ b/bfd/elf32-mips.c -@@ -2537,7 +2537,6 @@ static const struct ecoff_debug_swap mip - #define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mips_elf_adjust_dynamic_symbol --#define elf_backend_early_size_sections _bfd_mips_elf_early_size_sections - #define elf_backend_late_size_sections _bfd_mips_elf_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section _bfd_mips_elf_relocate_section ---- a/bfd/elf64-mips.c -+++ b/bfd/elf64-mips.c -@@ -4748,8 +4748,6 @@ const struct elf_size_info mips_elf64_si - #define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mips_elf_adjust_dynamic_symbol --#define elf_backend_early_size_sections \ -- _bfd_mips_elf_early_size_sections - #define elf_backend_late_size_sections \ - _bfd_mips_elf_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section ---- a/bfd/elfn32-mips.c -+++ b/bfd/elfn32-mips.c -@@ -4138,7 +4138,6 @@ static const struct ecoff_debug_swap mip - #define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag - #define elf_backend_adjust_dynamic_symbol \ - _bfd_mips_elf_adjust_dynamic_symbol --#define elf_backend_early_size_sections _bfd_mips_elf_early_size_sections - #define elf_backend_late_size_sections _bfd_mips_elf_late_size_sections - #define elf_backend_init_index_section _bfd_elf_init_1_index_section - #define elf_backend_relocate_section _bfd_mips_elf_relocate_section ---- a/bfd/elfxx-mips.c -+++ b/bfd/elfxx-mips.c -@@ -9639,48 +9639,6 @@ _bfd_mips_elf_adjust_dynamic_symbol (str - return _bfd_elf_adjust_dynamic_copy (info, h, s); - } - --/* This function is called after all the input files have been read, -- and the input sections have been assigned to output sections. We -- check for any mips16 stub sections that we can discard. */ -- --bool --_bfd_mips_elf_early_size_sections (bfd *output_bfd, -- struct bfd_link_info *info) --{ -- asection *sect; -- struct mips_elf_link_hash_table *htab; -- struct mips_htab_traverse_info hti; -- -- htab = mips_elf_hash_table (info); -- BFD_ASSERT (htab != NULL); -- -- /* The .reginfo section has a fixed size. */ -- sect = bfd_get_section_by_name (output_bfd, ".reginfo"); -- if (sect != NULL) -- { -- bfd_set_section_size (sect, sizeof (Elf32_External_RegInfo)); -- sect->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS; -- } -- -- /* The .MIPS.abiflags section has a fixed size. */ -- sect = bfd_get_section_by_name (output_bfd, ".MIPS.abiflags"); -- if (sect != NULL) -- { -- bfd_set_section_size (sect, sizeof (Elf_External_ABIFlags_v0)); -- sect->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS; -- } -- -- hti.info = info; -- hti.output_bfd = output_bfd; -- hti.error = false; -- mips_elf_link_hash_traverse (mips_elf_hash_table (info), -- mips_elf_check_symbols, &hti); -- if (hti.error) -- return false; -- -- return true; --} -- - /* If the link uses a GOT, lay it out and work out its size. */ - - static bool -@@ -9985,7 +9943,8 @@ mips_elf_set_plt_sym_value (struct mips_ - return true; - } - --/* Set the sizes of the dynamic sections. */ -+/* Set the sizes of the dynamic sections, some mips non-dynamic sections, -+ and check for any mips16 stub sections that we can discard. */ - - bool - _bfd_mips_elf_late_size_sections (bfd *output_bfd, -@@ -9995,14 +9954,39 @@ _bfd_mips_elf_late_size_sections (bfd *o - asection *s, *sreldyn; - bool reltext; - struct mips_elf_link_hash_table *htab; -+ struct mips_htab_traverse_info hti; - - htab = mips_elf_hash_table (info); - BFD_ASSERT (htab != NULL); -- dynobj = elf_hash_table (info)->dynobj; -+ -+ /* The .reginfo section has a fixed size. */ -+ s = bfd_get_section_by_name (output_bfd, ".reginfo"); -+ if (s != NULL) -+ { -+ bfd_set_section_size (s, sizeof (Elf32_External_RegInfo)); -+ s->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS; -+ } -+ -+ /* The .MIPS.abiflags section has a fixed size. */ -+ s = bfd_get_section_by_name (output_bfd, ".MIPS.abiflags"); -+ if (s != NULL) -+ { -+ bfd_set_section_size (s, sizeof (Elf_External_ABIFlags_v0)); -+ s->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS; -+ } -+ -+ hti.info = info; -+ hti.output_bfd = output_bfd; -+ hti.error = false; -+ mips_elf_link_hash_traverse (htab, mips_elf_check_symbols, &hti); -+ if (hti.error) -+ return false; -+ -+ dynobj = htab->root.dynobj; - if (dynobj == NULL) - return true; - -- if (elf_hash_table (info)->dynamic_sections_created) -+ if (htab->root.dynamic_sections_created) - { - /* Set the contents of the .interp section to the interpreter. */ - if (bfd_link_executable (info) && !info->nointerp) -@@ -10142,7 +10126,7 @@ _bfd_mips_elf_late_size_sections (bfd *o - } - } - else if (bfd_link_executable (info) -- && ! mips_elf_hash_table (info)->use_rld_obj_head -+ && !htab->use_rld_obj_head - && startswith (name, ".rld_map")) - { - /* We add a room for __rld_map. It will be filled in by the -@@ -10151,7 +10135,7 @@ _bfd_mips_elf_late_size_sections (bfd *o - } - else if (SGI_COMPAT (output_bfd) - && startswith (name, ".compact_rel")) -- s->size += mips_elf_hash_table (info)->compact_rel_size; -+ s->size += htab->compact_rel_size; - else if (s == htab->root.splt) - { - /* If the last PLT entry has a branch delay slot, allocate -@@ -10191,7 +10175,7 @@ _bfd_mips_elf_late_size_sections (bfd *o - } - } - -- if (elf_hash_table (info)->dynamic_sections_created) -+ if (htab->root.dynamic_sections_created) - { - /* Add some entries to the .dynamic section. We fill in the - values later, in _bfd_mips_elf_finish_dynamic_sections, but we -@@ -14934,7 +14918,7 @@ _bfd_mips_elf_final_link (bfd *abfd, str - input_section->flags &= ~SEC_HAS_CONTENTS; - } - -- /* Size has been set in _bfd_mips_elf_early_size_sections. */ -+ /* Size has been set in _bfd_mips_elf_late_size_sections. */ - BFD_ASSERT(o->size == sizeof (Elf_External_ABIFlags_v0)); - - /* Skip this section later on (I don't think this currently -@@ -14993,7 +14977,7 @@ _bfd_mips_elf_final_link (bfd *abfd, str - input_section->flags &= ~SEC_HAS_CONTENTS; - } - -- /* Size has been set in _bfd_mips_elf_early_size_sections. */ -+ /* Size has been set in _bfd_mips_elf_late_size_sections. */ - BFD_ASSERT(o->size == sizeof (Elf32_External_RegInfo)); - - /* Skip this section later on (I don't think this currently ---- a/bfd/elfxx-mips.h -+++ b/bfd/elfxx-mips.h -@@ -67,8 +67,6 @@ extern bool _bfd_mips_elf_check_relocs - (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *); - extern bool _bfd_mips_elf_adjust_dynamic_symbol - (struct bfd_link_info *, struct elf_link_hash_entry *); --extern bool _bfd_mips_elf_early_size_sections -- (bfd *, struct bfd_link_info *); - extern bool _bfd_mips_elf_late_size_sections - (bfd *, struct bfd_link_info *); - extern int _bfd_mips_elf_relocate_section diff --git a/toolchain/binutils/patches/2.41/300-001_ld_makefile_patch.patch b/toolchain/binutils/patches/2.41/300-001_ld_makefile_patch.patch deleted file mode 100644 index 2dafd92a01..0000000000 --- a/toolchain/binutils/patches/2.41/300-001_ld_makefile_patch.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/ld/Makefile.am -+++ b/ld/Makefile.am -@@ -50,7 +50,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) - # We put the scripts in the directory $(scriptdir)/ldscripts. - # We can't put the scripts in $(datadir) because the SEARCH_DIR - # directives need to be different for native and cross linkers. --scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) - - EMUL = @EMUL@ - EMULATION_OFILES = @EMULATION_OFILES@ ---- a/ld/Makefile.in -+++ b/ld/Makefile.in -@@ -573,7 +573,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) - # We put the scripts in the directory $(scriptdir)/ldscripts. - # We can't put the scripts in $(datadir) because the SEARCH_DIR - # directives need to be different for native and cross linkers. --scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) - BASEDIR = $(srcdir)/.. - BFDDIR = $(BASEDIR)/bfd - INCDIR = $(BASEDIR)/include diff --git a/toolchain/binutils/patches/2.41/400-mips_no_dynamic_linking_sym.patch b/toolchain/binutils/patches/2.41/400-mips_no_dynamic_linking_sym.patch deleted file mode 100644 index c50a988da4..0000000000 --- a/toolchain/binutils/patches/2.41/400-mips_no_dynamic_linking_sym.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/bfd/elfxx-mips.c -+++ b/bfd/elfxx-mips.c -@@ -8144,6 +8144,7 @@ _bfd_mips_elf_create_dynamic_sections (b - - name = SGI_COMPAT (abfd) ? "_DYNAMIC_LINK" : "_DYNAMIC_LINKING"; - bh = NULL; -+ if (0) { - if (!(_bfd_generic_link_add_one_symbol - (info, abfd, name, BSF_GLOBAL, bfd_abs_section_ptr, 0, - NULL, false, get_elf_backend_data (abfd)->collect, &bh))) -@@ -8156,6 +8157,7 @@ _bfd_mips_elf_create_dynamic_sections (b - - if (! bfd_elf_link_record_dynamic_symbol (info, h)) - return false; -+ } - - if (! mips_elf_hash_table (info)->use_rld_obj_head) - { diff --git a/toolchain/binutils/patches/2.42/003-PR-32372-opcodes-fix-std-gnu23-compatibility-wrt-static_asser.patch b/toolchain/binutils/patches/2.42/003-PR-32372-opcodes-fix-std-gnu23-compatibility-wrt-static_asser.patch new file mode 100644 index 0000000000..9454f3fa9f --- /dev/null +++ b/toolchain/binutils/patches/2.42/003-PR-32372-opcodes-fix-std-gnu23-compatibility-wrt-static_asser.patch @@ -0,0 +1,78 @@ +From 8ebe62f3f0d27806b1bf69f301f5e188b4acd2b4 Mon Sep 17 00:00:00 2001 +From: Sam James <sam@gentoo.org> +Date: Sat, 16 Nov 2024 05:03:52 +0000 +Subject: [PATCH] opcodes: fix -std=gnu23 compatibility wrt static_assert + +static_assert is declared in C23 so we can't reuse that identifier: +* Define our own static_assert conditionally; + +* Rename "static assert" hacks to _N as we do already in some places + to avoid a conflict. + +ChangeLog: + PR ld/32372 + + * i386-gen.c (static_assert): Define conditionally. + * mips-formats.h (MAPPED_INT): Rename identifier. + (MAPPED_REG): Rename identifier. + (OPTIONAL_MAPPED_REG): Rename identifier. + * s390-opc.c (static_assert): Define conditionally. +--- + opcodes/i386-gen.c | 2 ++ + opcodes/mips-formats.h | 6 +++--- + opcodes/s390-opc.c | 2 ++ + 3 files changed, 7 insertions(+), 3 deletions(-) + +--- a/opcodes/i386-gen.c ++++ b/opcodes/i386-gen.c +@@ -30,7 +30,9 @@ + + /* Build-time checks are preferrable over runtime ones. Use this construct + in preference where possible. */ ++#ifndef static_assert + #define static_assert(e) ((void)sizeof (struct { int _:1 - 2 * !(e); })) ++#endif + + static const char *program_name = NULL; + static int debug = 0; +--- a/opcodes/mips-formats.h ++++ b/opcodes/mips-formats.h +@@ -49,7 +49,7 @@ + #define MAPPED_INT(SIZE, LSB, MAP, PRINT_HEX) \ + { \ + typedef char ATTRIBUTE_UNUSED \ +- static_assert[(1 << (SIZE)) == ARRAY_SIZE (MAP)]; \ ++ static_assert_3[(1 << (SIZE)) == ARRAY_SIZE (MAP)]; \ + static const struct mips_mapped_int_operand op = { \ + { OP_MAPPED_INT, SIZE, LSB }, MAP, PRINT_HEX \ + }; \ +@@ -83,7 +83,7 @@ + #define MAPPED_REG(SIZE, LSB, BANK, MAP) \ + { \ + typedef char ATTRIBUTE_UNUSED \ +- static_assert[(1 << (SIZE)) == ARRAY_SIZE (MAP)]; \ ++ static_assert_4[(1 << (SIZE)) == ARRAY_SIZE (MAP)]; \ + static const struct mips_reg_operand op = { \ + { OP_REG, SIZE, LSB }, OP_REG_##BANK, MAP \ + }; \ +@@ -93,7 +93,7 @@ + #define OPTIONAL_MAPPED_REG(SIZE, LSB, BANK, MAP) \ + { \ + typedef char ATTRIBUTE_UNUSED \ +- static_assert[(1 << (SIZE)) == ARRAY_SIZE (MAP)]; \ ++ static_assert_5[(1 << (SIZE)) == ARRAY_SIZE (MAP)]; \ + static const struct mips_reg_operand op = { \ + { OP_OPTIONAL_REG, SIZE, LSB }, OP_REG_##BANK, MAP \ + }; \ +--- a/opcodes/s390-opc.c ++++ b/opcodes/s390-opc.c +@@ -36,7 +36,9 @@ + + /* Build-time checks are preferrable over runtime ones. Use this construct + in preference where possible. */ ++#ifndef static_assert + #define static_assert(e) ((void)sizeof (struct { int _:1 - 2 * !(e); })) ++#endif + + #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) + diff --git a/toolchain/binutils/patches/2.43.1/003-PR-32372-opcodes-fix-std-gnu23-compatibility-wrt-static_asser.patch b/toolchain/binutils/patches/2.43.1/003-PR-32372-opcodes-fix-std-gnu23-compatibility-wrt-static_asser.patch new file mode 100644 index 0000000000..9454f3fa9f --- /dev/null +++ b/toolchain/binutils/patches/2.43.1/003-PR-32372-opcodes-fix-std-gnu23-compatibility-wrt-static_asser.patch @@ -0,0 +1,78 @@ +From 8ebe62f3f0d27806b1bf69f301f5e188b4acd2b4 Mon Sep 17 00:00:00 2001 +From: Sam James <sam@gentoo.org> +Date: Sat, 16 Nov 2024 05:03:52 +0000 +Subject: [PATCH] opcodes: fix -std=gnu23 compatibility wrt static_assert + +static_assert is declared in C23 so we can't reuse that identifier: +* Define our own static_assert conditionally; + +* Rename "static assert" hacks to _N as we do already in some places + to avoid a conflict. + +ChangeLog: + PR ld/32372 + + * i386-gen.c (static_assert): Define conditionally. + * mips-formats.h (MAPPED_INT): Rename identifier. + (MAPPED_REG): Rename identifier. + (OPTIONAL_MAPPED_REG): Rename identifier. + * s390-opc.c (static_assert): Define conditionally. +--- + opcodes/i386-gen.c | 2 ++ + opcodes/mips-formats.h | 6 +++--- + opcodes/s390-opc.c | 2 ++ + 3 files changed, 7 insertions(+), 3 deletions(-) + +--- a/opcodes/i386-gen.c ++++ b/opcodes/i386-gen.c +@@ -30,7 +30,9 @@ + + /* Build-time checks are preferrable over runtime ones. Use this construct + in preference where possible. */ ++#ifndef static_assert + #define static_assert(e) ((void)sizeof (struct { int _:1 - 2 * !(e); })) ++#endif + + static const char *program_name = NULL; + static int debug = 0; +--- a/opcodes/mips-formats.h ++++ b/opcodes/mips-formats.h +@@ -49,7 +49,7 @@ + #define MAPPED_INT(SIZE, LSB, MAP, PRINT_HEX) \ + { \ + typedef char ATTRIBUTE_UNUSED \ +- static_assert[(1 << (SIZE)) == ARRAY_SIZE (MAP)]; \ ++ static_assert_3[(1 << (SIZE)) == ARRAY_SIZE (MAP)]; \ + static const struct mips_mapped_int_operand op = { \ + { OP_MAPPED_INT, SIZE, LSB }, MAP, PRINT_HEX \ + }; \ +@@ -83,7 +83,7 @@ + #define MAPPED_REG(SIZE, LSB, BANK, MAP) \ + { \ + typedef char ATTRIBUTE_UNUSED \ +- static_assert[(1 << (SIZE)) == ARRAY_SIZE (MAP)]; \ ++ static_assert_4[(1 << (SIZE)) == ARRAY_SIZE (MAP)]; \ + static const struct mips_reg_operand op = { \ + { OP_REG, SIZE, LSB }, OP_REG_##BANK, MAP \ + }; \ +@@ -93,7 +93,7 @@ + #define OPTIONAL_MAPPED_REG(SIZE, LSB, BANK, MAP) \ + { \ + typedef char ATTRIBUTE_UNUSED \ +- static_assert[(1 << (SIZE)) == ARRAY_SIZE (MAP)]; \ ++ static_assert_5[(1 << (SIZE)) == ARRAY_SIZE (MAP)]; \ + static const struct mips_reg_operand op = { \ + { OP_OPTIONAL_REG, SIZE, LSB }, OP_REG_##BANK, MAP \ + }; \ +--- a/opcodes/s390-opc.c ++++ b/opcodes/s390-opc.c +@@ -36,7 +36,9 @@ + + /* Build-time checks are preferrable over runtime ones. Use this construct + in preference where possible. */ ++#ifndef static_assert + #define static_assert(e) ((void)sizeof (struct { int _:1 - 2 * !(e); })) ++#endif + + #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) + diff --git a/toolchain/binutils/patches/2.37/300-001_ld_makefile_patch.patch b/toolchain/binutils/patches/2.43.1/300-001_ld_makefile_patch.patch index f1cbb8198b..64dae55dd7 100644 --- a/toolchain/binutils/patches/2.37/300-001_ld_makefile_patch.patch +++ b/toolchain/binutils/patches/2.43.1/300-001_ld_makefile_patch.patch @@ -1,6 +1,6 @@ --- a/ld/Makefile.am +++ b/ld/Makefile.am -@@ -50,7 +50,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) +@@ -50,7 +50,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CFLAGS) # We put the scripts in the directory $(scriptdir)/ldscripts. # We can't put the scripts in $(datadir) because the SEARCH_DIR # directives need to be different for native and cross linkers. @@ -11,7 +11,7 @@ EMULATION_OFILES = @EMULATION_OFILES@ --- a/ld/Makefile.in +++ b/ld/Makefile.in -@@ -561,7 +561,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) +@@ -583,7 +583,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CFLAGS) # We put the scripts in the directory $(scriptdir)/ldscripts. # We can't put the scripts in $(datadir) because the SEARCH_DIR # directives need to be different for native and cross linkers. diff --git a/toolchain/binutils/patches/2.40/400-mips_no_dynamic_linking_sym.patch b/toolchain/binutils/patches/2.43.1/400-mips_no_dynamic_linking_sym.patch index aeb5a993a6..d0cc7ddc69 100644 --- a/toolchain/binutils/patches/2.40/400-mips_no_dynamic_linking_sym.patch +++ b/toolchain/binutils/patches/2.43.1/400-mips_no_dynamic_linking_sym.patch @@ -1,6 +1,6 @@ --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c -@@ -8119,6 +8119,7 @@ _bfd_mips_elf_create_dynamic_sections (b +@@ -8161,6 +8161,7 @@ _bfd_mips_elf_create_dynamic_sections (b name = SGI_COMPAT (abfd) ? "_DYNAMIC_LINK" : "_DYNAMIC_LINKING"; bh = NULL; @@ -8,7 +8,7 @@ if (!(_bfd_generic_link_add_one_symbol (info, abfd, name, BSF_GLOBAL, bfd_abs_section_ptr, 0, NULL, false, get_elf_backend_data (abfd)->collect, &bh))) -@@ -8131,6 +8132,7 @@ _bfd_mips_elf_create_dynamic_sections (b +@@ -8173,6 +8174,7 @@ _bfd_mips_elf_create_dynamic_sections (b if (! bfd_elf_link_record_dynamic_symbol (info, h)) return false; diff --git a/toolchain/binutils/patches/2.41/500-Change-default-emulation-for-mips64-linux.patch b/toolchain/binutils/patches/2.43.1/500-Change-default-emulation-for-mips64-linux.patch index 60676bbe54..df38fcaba1 100644 --- a/toolchain/binutils/patches/2.41/500-Change-default-emulation-for-mips64-linux.patch +++ b/toolchain/binutils/patches/2.43.1/500-Change-default-emulation-for-mips64-linux.patch @@ -1,6 +1,6 @@ --- a/bfd/config.bfd +++ b/bfd/config.bfd -@@ -947,8 +947,8 @@ case "${targ}" in +@@ -962,8 +962,8 @@ case "${targ}" in want64=true ;; mips64*el-*-linux*) @@ -11,7 +11,7 @@ ;; mips64*-*-linux*-gnuabi64) targ_defvec=mips_elf64_trad_be_vec -@@ -956,8 +956,8 @@ case "${targ}" in +@@ -971,8 +971,8 @@ case "${targ}" in want64=true ;; mips64*-*-linux*) @@ -24,7 +24,7 @@ targ_defvec=mips_elf32_trad_le_vec --- a/ld/configure.tgt +++ b/ld/configure.tgt -@@ -585,8 +585,8 @@ mips64*el-*-linux-gnuabi64) +@@ -597,8 +597,8 @@ mips64*el-*-linux-gnuabi64) targ_extra_emuls="elf64btsmip elf32ltsmipn32 elf32btsmipn32 elf32ltsmip elf32btsmip" targ_extra_libpath=$targ_extra_emuls ;; @@ -35,7 +35,7 @@ targ_extra_libpath=$targ_extra_emuls ;; mips64*-*-linux-gnuabi64) -@@ -594,8 +594,8 @@ mips64*-*-linux-gnuabi64) +@@ -606,8 +606,8 @@ mips64*-*-linux-gnuabi64) targ_extra_emuls="elf64ltsmip elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip" targ_extra_libpath=$targ_extra_emuls ;; diff --git a/toolchain/binutils/patches/2.39/300-001_ld_makefile_patch.patch b/toolchain/binutils/patches/2.44/300-001_ld_makefile_patch.patch index ac80bf4259..64dae55dd7 100644 --- a/toolchain/binutils/patches/2.39/300-001_ld_makefile_patch.patch +++ b/toolchain/binutils/patches/2.44/300-001_ld_makefile_patch.patch @@ -1,6 +1,6 @@ --- a/ld/Makefile.am +++ b/ld/Makefile.am -@@ -50,7 +50,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) +@@ -50,7 +50,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CFLAGS) # We put the scripts in the directory $(scriptdir)/ldscripts. # We can't put the scripts in $(datadir) because the SEARCH_DIR # directives need to be different for native and cross linkers. @@ -11,7 +11,7 @@ EMULATION_OFILES = @EMULATION_OFILES@ --- a/ld/Makefile.in +++ b/ld/Makefile.in -@@ -569,7 +569,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) +@@ -583,7 +583,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CFLAGS) # We put the scripts in the directory $(scriptdir)/ldscripts. # We can't put the scripts in $(datadir) because the SEARCH_DIR # directives need to be different for native and cross linkers. diff --git a/toolchain/binutils/patches/2.37/400-mips_no_dynamic_linking_sym.patch b/toolchain/binutils/patches/2.44/400-mips_no_dynamic_linking_sym.patch index 070247ecf0..6765041972 100644 --- a/toolchain/binutils/patches/2.37/400-mips_no_dynamic_linking_sym.patch +++ b/toolchain/binutils/patches/2.44/400-mips_no_dynamic_linking_sym.patch @@ -1,6 +1,6 @@ --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c -@@ -8057,6 +8057,7 @@ _bfd_mips_elf_create_dynamic_sections (b +@@ -8148,6 +8148,7 @@ _bfd_mips_elf_create_dynamic_sections (b name = SGI_COMPAT (abfd) ? "_DYNAMIC_LINK" : "_DYNAMIC_LINKING"; bh = NULL; @@ -8,7 +8,7 @@ if (!(_bfd_generic_link_add_one_symbol (info, abfd, name, BSF_GLOBAL, bfd_abs_section_ptr, 0, NULL, false, get_elf_backend_data (abfd)->collect, &bh))) -@@ -8069,6 +8070,7 @@ _bfd_mips_elf_create_dynamic_sections (b +@@ -8160,6 +8161,7 @@ _bfd_mips_elf_create_dynamic_sections (b if (! bfd_elf_link_record_dynamic_symbol (info, h)) return false; diff --git a/toolchain/binutils/patches/2.39/500-Change-default-emulation-for-mips64-linux.patch b/toolchain/binutils/patches/2.44/500-Change-default-emulation-for-mips64-linux.patch index 8a43563db0..df38fcaba1 100644 --- a/toolchain/binutils/patches/2.39/500-Change-default-emulation-for-mips64-linux.patch +++ b/toolchain/binutils/patches/2.44/500-Change-default-emulation-for-mips64-linux.patch @@ -1,7 +1,7 @@ --- a/bfd/config.bfd +++ b/bfd/config.bfd -@@ -928,12 +928,12 @@ case "${targ}" in - targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_be_vec mips_ecoff_le_vec" +@@ -962,8 +962,8 @@ case "${targ}" in + want64=true ;; mips64*el-*-linux*) - targ_defvec=mips_elf32_ntrad_le_vec @@ -9,6 +9,11 @@ + targ_defvec=mips_elf64_trad_le_vec + targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_be_vec" ;; + mips64*-*-linux*-gnuabi64) + targ_defvec=mips_elf64_trad_be_vec +@@ -971,8 +971,8 @@ case "${targ}" in + want64=true + ;; mips64*-*-linux*) - targ_defvec=mips_elf32_ntrad_be_vec - targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec" @@ -19,9 +24,9 @@ targ_defvec=mips_elf32_trad_le_vec --- a/ld/configure.tgt +++ b/ld/configure.tgt -@@ -580,12 +580,12 @@ mips*-*-vxworks*) targ_emul=elf32ebmipvx - ;; - mips*-*-windiss) targ_emul=elf32mipswindiss +@@ -597,8 +597,8 @@ mips64*el-*-linux-gnuabi64) + targ_extra_emuls="elf64btsmip elf32ltsmipn32 elf32btsmipn32 elf32ltsmip elf32btsmip" + targ_extra_libpath=$targ_extra_emuls ;; -mips64*el-*-linux-*) targ_emul=elf32ltsmipn32 - targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip" @@ -29,6 +34,11 @@ + targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32ltsmip elf32btsmip elf64btsmip" targ_extra_libpath=$targ_extra_emuls ;; + mips64*-*-linux-gnuabi64) +@@ -606,8 +606,8 @@ mips64*-*-linux-gnuabi64) + targ_extra_emuls="elf64ltsmip elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip" + targ_extra_libpath=$targ_extra_emuls + ;; -mips64*-*-linux-*) targ_emul=elf32btsmipn32 - targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip" +mips64*-*-linux-*) targ_emul=elf64btsmip diff --git a/toolchain/binutils/patches/2.38/300-001_ld_makefile_patch.patch b/toolchain/binutils/patches/2.45/300-001_ld_makefile_patch.patch index ecc9dd64e3..64dae55dd7 100644 --- a/toolchain/binutils/patches/2.38/300-001_ld_makefile_patch.patch +++ b/toolchain/binutils/patches/2.45/300-001_ld_makefile_patch.patch @@ -1,6 +1,6 @@ --- a/ld/Makefile.am +++ b/ld/Makefile.am -@@ -50,7 +50,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) +@@ -50,7 +50,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CFLAGS) # We put the scripts in the directory $(scriptdir)/ldscripts. # We can't put the scripts in $(datadir) because the SEARCH_DIR # directives need to be different for native and cross linkers. @@ -11,7 +11,7 @@ EMULATION_OFILES = @EMULATION_OFILES@ --- a/ld/Makefile.in +++ b/ld/Makefile.in -@@ -563,7 +563,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) +@@ -583,7 +583,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CFLAGS) # We put the scripts in the directory $(scriptdir)/ldscripts. # We can't put the scripts in $(datadir) because the SEARCH_DIR # directives need to be different for native and cross linkers. diff --git a/toolchain/binutils/patches/2.39/400-mips_no_dynamic_linking_sym.patch b/toolchain/binutils/patches/2.45/400-mips_no_dynamic_linking_sym.patch index f499dfdc02..5614691107 100644 --- a/toolchain/binutils/patches/2.39/400-mips_no_dynamic_linking_sym.patch +++ b/toolchain/binutils/patches/2.45/400-mips_no_dynamic_linking_sym.patch @@ -1,6 +1,6 @@ --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c -@@ -8066,6 +8066,7 @@ _bfd_mips_elf_create_dynamic_sections (b +@@ -8194,6 +8194,7 @@ _bfd_mips_elf_create_dynamic_sections (b name = SGI_COMPAT (abfd) ? "_DYNAMIC_LINK" : "_DYNAMIC_LINKING"; bh = NULL; @@ -8,7 +8,7 @@ if (!(_bfd_generic_link_add_one_symbol (info, abfd, name, BSF_GLOBAL, bfd_abs_section_ptr, 0, NULL, false, get_elf_backend_data (abfd)->collect, &bh))) -@@ -8078,6 +8079,7 @@ _bfd_mips_elf_create_dynamic_sections (b +@@ -8206,6 +8207,7 @@ _bfd_mips_elf_create_dynamic_sections (b if (! bfd_elf_link_record_dynamic_symbol (info, h)) return false; diff --git a/toolchain/binutils/patches/2.40/500-Change-default-emulation-for-mips64-linux.patch b/toolchain/binutils/patches/2.45/500-Change-default-emulation-for-mips64-linux.patch index 14a18a1d80..44177e30f2 100644 --- a/toolchain/binutils/patches/2.40/500-Change-default-emulation-for-mips64-linux.patch +++ b/toolchain/binutils/patches/2.45/500-Change-default-emulation-for-mips64-linux.patch @@ -1,7 +1,7 @@ --- a/bfd/config.bfd +++ b/bfd/config.bfd -@@ -944,12 +944,12 @@ case "${targ}" in - targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_be_vec mips_ecoff_le_vec" +@@ -961,16 +961,16 @@ case "${targ}" in + targ_selvecs="mips_elf64_trad_be_vec mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec" ;; mips64*el-*-linux*) - targ_defvec=mips_elf32_ntrad_le_vec @@ -9,6 +9,10 @@ + targ_defvec=mips_elf64_trad_le_vec + targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_be_vec" ;; + mips64*-*-linux*-gnuabi64) + targ_defvec=mips_elf64_trad_be_vec + targ_selvecs="mips_elf64_trad_le_vec mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec" + ;; mips64*-*-linux*) - targ_defvec=mips_elf32_ntrad_be_vec - targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec" @@ -19,9 +23,9 @@ targ_defvec=mips_elf32_trad_le_vec --- a/ld/configure.tgt +++ b/ld/configure.tgt -@@ -585,12 +585,12 @@ mips*-*-vxworks*) targ_emul=elf32ebmipvx - ;; - mips*-*-windiss) targ_emul=elf32mipswindiss +@@ -597,8 +597,8 @@ mips64*el-*-linux-gnuabi64) + targ_extra_emuls="elf64btsmip elf32ltsmipn32 elf32btsmipn32 elf32ltsmip elf32btsmip" + targ_extra_libpath=$targ_extra_emuls ;; -mips64*el-*-linux-*) targ_emul=elf32ltsmipn32 - targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip" @@ -29,6 +33,11 @@ + targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32ltsmip elf32btsmip elf64btsmip" targ_extra_libpath=$targ_extra_emuls ;; + mips64*-*-linux-gnuabi64) +@@ -606,8 +606,8 @@ mips64*-*-linux-gnuabi64) + targ_extra_emuls="elf64ltsmip elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip" + targ_extra_libpath=$targ_extra_emuls + ;; -mips64*-*-linux-*) targ_emul=elf32btsmipn32 - targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip" +mips64*-*-linux-*) targ_emul=elf64btsmip |