Remove check_relocs_after_open_input
Commit Message
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.
@@ -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;
@@ -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
@@ -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
@@ -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
@@ -25,15 +25,6 @@
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
@@ -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
@@ -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
@@ -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