NEWS and documentation for alias default-args related concept and commands.
[deliverable/binutils-gdb.git] / ld / ldmain.c
index 2fbd8b9da956b6d8c437833f2831f18f45194e89..d34d30ae3371a88e94abb5d9774a8325149daee9 100644 (file)
@@ -1,5 +1,5 @@
 /* Main program of GNU linker.
-   Copyright (C) 1991-2019 Free Software Foundation, Inc.
+   Copyright (C) 1991-2020 Free Software Foundation, Inc.
    Written by Steve Chamberlain steve@cygnus.com
 
    This file is part of the GNU Binutils.
@@ -27,6 +27,7 @@
 #include "bfdlink.h"
 #include "ctf-api.h"
 #include "filenames.h"
+#include "elf/common.h"
 
 #include "ld.h"
 #include "ldmain.h"
 #include "ldfile.h"
 #include "ldemul.h"
 #include "ldctor.h"
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
 #include "plugin.h"
 #include "plugin-api.h"
-#endif /* ENABLE_PLUGINS */
+#endif /* BFD_SUPPORTS_PLUGINS */
 
 /* Somewhere above, sys/stat.h got included.  */
 #if !defined(S_ISDIR) && defined(S_IFDIR)
@@ -163,7 +164,7 @@ static void
 ld_cleanup (void)
 {
   bfd_cache_close_all ();
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
   plugin_call_cleanup ();
 #endif
   if (output_filename && delete_output_file_on_failure)
@@ -286,6 +287,7 @@ main (int argc, char **argv)
   link_info.combreloc = TRUE;
   link_info.strip_discarded = TRUE;
   link_info.prohibit_multiple_definition_absolute = FALSE;
+  link_info.textrel_check = DEFAULT_LD_TEXTREL_CHECK;
   link_info.emit_hash = DEFAULT_EMIT_SYSV_HASH;
   link_info.emit_gnu_hash = DEFAULT_EMIT_GNU_HASH;
   link_info.callbacks = &link_callbacks;
@@ -306,6 +308,7 @@ main (int argc, char **argv)
 #ifdef DEFAULT_NEW_DTAGS
   link_info.new_dtags = DEFAULT_NEW_DTAGS;
 #endif
+  link_info.start_stop_visibility = STV_PROTECTED;
 
   ldfile_add_arch ("");
   emulation = get_emulation (argc, argv);
@@ -320,10 +323,10 @@ main (int argc, char **argv)
   if (config.hash_table_size != 0)
     bfd_hash_set_default_size (config.hash_table_size);
 
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
   /* Now all the plugin arguments have been gathered, we can load them.  */
   plugin_load_plugins ();
-#endif /* ENABLE_PLUGINS */
+#endif /* BFD_SUPPORTS_PLUGINS */
 
   ldemul_set_symbols ();
 
@@ -815,8 +818,8 @@ add_archive_element (struct bfd_link_info *info,
   input = (lang_input_statement_type *)
       xcalloc (1, sizeof (lang_input_statement_type));
   input->header.type = lang_input_statement_enum;
-  input->filename = abfd->filename;
-  input->local_sym_name = abfd->filename;
+  input->filename = bfd_get_filename (abfd);
+  input->local_sym_name = bfd_get_filename (abfd);
   input->the_bfd = abfd;
 
   parent = bfd_usrdata (abfd->my_archive);
@@ -827,7 +830,7 @@ add_archive_element (struct bfd_link_info *info,
      (if enabled) may possibly alter it to point to a replacement
      BFD, but we still want to output the original BFD filename.  */
   orig_input = *input;
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
   if (link_info.lto_plugin_active)
     {
       /* We must offer this archive member to the plugins to claim.  */
@@ -839,7 +842,7 @@ add_archive_element (struct bfd_link_info *info,
              /* Don't claim new IR symbols after all IR symbols have
                 been claimed.  */
              if (verbose)
-               info_msg ("%pI: no new IR symbols to claimi\n",
+               info_msg ("%pI: no new IR symbols to claim\n",
                          &orig_input);
              input->flags.claimed = 0;
              return FALSE;
@@ -848,7 +851,7 @@ add_archive_element (struct bfd_link_info *info,
          *subsbfd = input->the_bfd;
        }
     }
-#endif /* ENABLE_PLUGINS */
+#endif /* BFD_SUPPORTS_PLUGINS */
 
   ldlang_add_file (input);
 
@@ -1349,8 +1352,7 @@ undefined_symbol (struct bfd_link_info *info,
   else
     {
       error_count = 0;
-      if (error_name != NULL)
-       free (error_name);
+      free (error_name);
       error_name = xstrdup (name);
     }
 
This page took 0.02495 seconds and 4 git commands to generate.