/* 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.
#include "libiberty.h"
#include "progress.h"
#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)
einfo,
info_msg,
minfo,
- ldlang_override_segment_assignment
+ ldlang_override_segment_assignment,
+ ldlang_ctf_apply_strsym,
+ ldlang_write_ctf_late
};
static bfd_assert_handler_type default_bfd_assert_handler;
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)
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;
#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);
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 ();
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);
(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. */
/* 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;
*subsbfd = input->the_bfd;
}
}
-#endif /* ENABLE_PLUGINS */
+#endif /* BFD_SUPPORTS_PLUGINS */
ldlang_add_file (input);
else
{
error_count = 0;
- if (error_name != NULL)
- free (error_name);
+ free (error_name);
error_name = xstrdup (name);
}