]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove check_relocs_after_open_input
authorAlan Modra <amodra@gmail.com>
Fri, 1 May 2026 01:17:54 +0000 (10:47 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 1 May 2026 12:48:44 +0000 (22:18 +0930)
After commit 5c3261b0e834 there was no need for this flag.  Remove it
and tidy places that used it.

include/
* bfdlink.h (struct bfd_link_info): Delete
check_relocs_after_open_input.
ld/
* emultempl/aarch64elf.em (before_parse): Don't set
link_info.check_relocs_after_open_input.
* emultempl/armelf.em (before_parse): Likewise.
* emultempl/elf.em (before_parse): Likewise.
* emultempl/scoreelf.em (before_parse): Likewise.
* emultempl/mmix-elfnmmo.em (mmix_before_parse): Delete.
(LDEMUL_BEFORE_PARSE): Don't define.
* emultempl/mmixelf.em (elfmmix_before_parse): Call elf.em
before_parse.
* ldlang.c (lang_check_relocs): Don't test
link_info.check_relocs_after_open_input.

include/bfdlink.h
ld/emultempl/aarch64elf.em
ld/emultempl/armelf.em
ld/emultempl/elf.em
ld/emultempl/mmix-elfnmmo.em
ld/emultempl/mmixelf.em
ld/emultempl/scoreelf.em
ld/ldlang.c

index a412f9c241a52cac731cc35f87e57b02b9054ab3..90b5d8a8d854932c1eeda3bf421240b90a66a676 100644 (file)
@@ -572,10 +572,6 @@ struct bfd_link_info
   /* TRUE if program headers ought to be loaded.  */
   unsigned int load_phdrs: 1;
 
-  /* TRUE if we should check relocations after all input files have
-     been opened.  */
-  unsigned int check_relocs_after_open_input: 1;
-
   /* TRUE if generation of .interp/PT_INTERP should be suppressed.  */
   unsigned int nointerp: 1;
 
index 010dbbfaed23ebe31a0363a97259d67774d54d78..54177249f24613431d76ef2ad4ed6a747d776ed2 100644 (file)
@@ -59,7 +59,6 @@ gld${EMULATION_NAME}_before_parse (void)
   input_flags.dynamic = ${DYNAMIC_LINK-true};
   config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo true ; else echo false ; fi`;
   config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo true ; else echo false ; fi`;
-  link_info.check_relocs_after_open_input = true;
 EOF
 if test -n "$COMMONPAGESIZE"; then
 fragment <<EOF
index a17d6136a2b11e7c268d96d9379b90e9de4368c5..c743c6f80d49a7a0a1d233fa710a1d024ea0c480 100644 (file)
@@ -59,7 +59,6 @@ gld${EMULATION_NAME}_before_parse (void)
   input_flags.dynamic = ${DYNAMIC_LINK-true};
   config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo true ; else echo false ; fi`;
   config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo true ; else echo false ; fi`;
-  link_info.check_relocs_after_open_input = true;
 EOF
 if test -n "$COMMONPAGESIZE"; then
 fragment <<EOF
index 37bdfff051cb11e5871fe6a99ec29864ca31e968..9fcf9fa154d7fd8f0a90eda2b0367bc92e8e706f 100644 (file)
@@ -84,7 +84,6 @@ gld${EMULATION_NAME}_before_parse (void)
   input_flags.dynamic = ${DYNAMIC_LINK-true};
   config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo true ; else echo false ; fi`;
   config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo true ; else echo false ; fi`;
-  link_info.check_relocs_after_open_input = true;
 EOF
 if test -n "$COMMONPAGESIZE"; then
 fragment <<EOF
index 36b99ecf9c9cabd460597b6185ab1824f89d08bd..c4a501cc530158c284a81104ff3365cf0e437fa0 100644 (file)
 fragment <<EOF
 #include "elf/mmix.h"
 
-static void gld${EMULATION_NAME}_before_parse (void);
-
-static void
-mmix_before_parse (void)
-{
-  link_info.check_relocs_after_open_input = true;
-  gld${EMULATION_NAME}_before_parse ();
-}
-
 /* Set up handling of linker-allocated global registers.  */
 
 static void
@@ -117,6 +108,5 @@ mmix_after_allocation (void)
 }
 EOF
 
-LDEMUL_BEFORE_PARSE=mmix_before_parse
 LDEMUL_AFTER_ALLOCATION=mmix_after_allocation
 LDEMUL_BEFORE_ALLOCATION=mmix_before_allocation
index 23515c3fb41de082ec3fa459ac219e3921b6d61a..324e8877a6dbaef1e0738a0448f56c3f188b41c9 100644 (file)
@@ -29,7 +29,7 @@ fragment <<EOF
 static void
 elfmmix_before_parse (void)
 {
-  mmix_before_parse ();
+  gld${EMULATION_NAME}_before_parse ();
 
   /* Make sure we don't create a demand-paged executable.  Unfortunately
      this isn't changeable with a command-line option.  It makes no
index ac33bfc3fc7ba73c82777101e5dd5aaaf5cf7886..46082603ef0d503328c2973e0669d53fe05caab6 100644 (file)
@@ -39,7 +39,6 @@ gld${EMULATION_NAME}_before_parse (void)
   input_flags.dynamic = ${DYNAMIC_LINK-true};
   config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo true ; else echo false ; fi`;
   config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo true ; else echo false ; fi`;
-  link_info.check_relocs_after_open_input = true;
 EOF
 if test -n "$COMMONPAGESIZE"; then
 fragment <<EOF
index d75f9df4d434f03ecbc28f6b4633e457fad6bd98..dec3d586671f1627403f78f4e3baeff63a0b8a2c 100644 (file)
@@ -8463,21 +8463,15 @@ lang_add_gc_name (const char *name)
 static void
 lang_check_relocs (void)
 {
-  if (link_info.check_relocs_after_open_input)
-    {
-      bfd *abfd;
-
-      for (abfd = link_info.input_bfds;
-          abfd != (bfd *) NULL; abfd = abfd->link.next)
-       if (!bfd_link_check_relocs (abfd, &link_info))
-         {
-           /* No object output, fail return.  */
-           config.make_executable = false;
-           /* Note: we do not abort the loop, but rather
-              continue the scan in case there are other
-              bad relocations to report.  */
-         }
-    }
+  for (bfd *abfd = link_info.input_bfds; abfd != NULL; abfd = abfd->link.next)
+    if (!bfd_link_check_relocs (abfd, &link_info))
+      {
+       /* No object output, fail return.  */
+       config.make_executable = false;
+       /* Note: we do not abort the loop, but rather
+          continue the scan in case there are other
+          bad relocations to report.  */
+      }
 }
 
 /* Look through all output sections looking for places where we can