frv: elf32_frvfdpic_late_size_sections

Message ID fd669648cf980c33a9f2856babf5c80fe57efa72.1778457849.git.amodra@gmail.com
State New
Headers
Series frv: elf32_frvfdpic_late_size_sections |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_binutils_check--master-arm success Test passed
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 success Test passed

Commit Message

Alan Modra May 11, 2026, 5:11 a.m. UTC
  This function runs passes over frvfdpic_relocs_info if dynobj is set,
which is OK since the two variables are both non-NULL or both NULL in
the current linker.  That may change in the future, so test
frvfdpic_relocs_info directly rather than dynobj.

	* elf32-frv.c (elf32_frvfdpic_late_size_sections): Omit dynobj
	test.  Instead test frvfdpic_relocs_info.
  

Patch

diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c
index 54b16cd285c..d8a338bb98a 100644
--- a/bfd/elf32-frv.c
+++ b/bfd/elf32-frv.c
@@ -5435,10 +5435,6 @@  elf32_frvfdpic_late_size_sections (bfd *output_bfd,
   asection *s;
   struct _frvfdpic_dynamic_got_plt_info gpinfo;
 
-  dynobj = elf_hash_table (info)->dynobj;
-  if (dynobj == NULL)
-    return true;
-
   if (elf_hash_table (info)->dynamic_sections_created)
     {
       /* Set the contents of the .interp section to the interpreter.  */
@@ -5452,6 +5448,9 @@  elf32_frvfdpic_late_size_sections (bfd *output_bfd,
 	}
     }
 
+  if (frvfdpic_relocs_info (info) == NULL)
+    return true;
+
   memset (&gpinfo, 0, sizeof (gpinfo));
   gpinfo.g.info = info;
 
@@ -5470,6 +5469,7 @@  elf32_frvfdpic_late_size_sections (bfd *output_bfd,
 
   /* Allocate space to save the summary information, we're going to
      use it if we're doing relaxations.  */
+  dynobj = elf_hash_table (info)->dynobj;
   frvfdpic_dynamic_got_plt_info (info) = bfd_alloc (dynobj, sizeof (gpinfo.g));
 
   if (!_frvfdpic_size_got_plt (output_bfd, &gpinfo))