/* Main program of GNU linker.
- Copyright (C) 1991-2017 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
Written by Steve Chamberlain steve@cygnus.com
This file is part of the GNU Binutils.
#include <string.h>
-#ifdef HAVE_SBRK
-#if !HAVE_DECL_SBRK
-extern void *sbrk ();
-#endif
-#endif
-
#ifndef TARGET_SYSTEM_ROOT
#define TARGET_SYSTEM_ROOT ""
#endif
{
char *emulation;
long start_time = get_run_time ();
-#ifdef HAVE_SBRK
- char *start_sbrk = (char *) sbrk (0);
-#endif
#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
setlocale (LC_MESSAGES, "");
link_info.keep_memory = TRUE;
link_info.combreloc = TRUE;
link_info.strip_discarded = TRUE;
- link_info.emit_hash = TRUE;
+ link_info.emit_hash = DEFAULT_EMIT_SYSV_HASH;
+ link_info.emit_gnu_hash = DEFAULT_EMIT_GNU_HASH;
link_info.callbacks = &link_callbacks;
link_info.input_bfds_tail = &link_info.input_bfds;
/* SVR4 linkers seem to set DT_INIT and DT_FINI based on magic _init
#ifdef DEFAULT_FLAG_COMPRESS_DEBUG
link_info.compress_debug = COMPRESS_DEBUG_GABI_ZLIB;
#endif
+#ifdef DEFAULT_NEW_DTAGS
+ link_info.new_dtags = DEFAULT_NEW_DTAGS;
+#endif
ldfile_add_arch ("");
emulation = get_emulation (argc, argv);
info_msg ("\n==================================================\n");
}
+ if (command_line.force_group_allocation
+ || !bfd_link_relocatable (&link_info))
+ link_info.resolve_section_groups = TRUE;
+ else
+ link_info.resolve_section_groups = FALSE;
+
if (command_line.print_output_format)
info_msg ("%s\n", lang_get_output_target ());
if (argc == 2 && version_printed)
xexit (0);
+ if (link_info.inhibit_common_definition && !bfd_link_dll (&link_info))
+ einfo (_("%P%F: --no-define-common may not be used without -shared\n"));
+
if (!lang_has_input_file)
{
if (version_printed || command_line.print_output_format)
if (config.stats)
{
-#ifdef HAVE_SBRK
- char *lim = (char *) sbrk (0);
-#endif
long run_time = get_run_time () - start_time;
fflush (stdout);
fprintf (stderr, _("%s: total time in link: %ld.%06ld\n"),
program_name, run_time / 1000000, run_time % 1000000);
-#ifdef HAVE_SBRK
- fprintf (stderr, _("%s: data size %ld\n"), program_name,
- (long) (lim - start_sbrk));
-#endif
fflush (stderr);
}
bfd **subsbfd ATTRIBUTE_UNUSED)
{
lang_input_statement_type *input;
+ lang_input_statement_type *parent;
lang_input_statement_type orig_input;
input = (lang_input_statement_type *)
input->local_sym_name = abfd->filename;
input->the_bfd = abfd;
+ parent = abfd->my_archive->usrdata;
+ if (parent != NULL && !parent->flags.reload)
+ parent->next = (lang_statement_union_type *) input;
+
/* Save the original data for trace files/tries below, as plugins
(if enabled) may possibly alter it to point to a replacement
BFD, but we still want to output the original BFD filename. */
if (!header_printed)
{
- char buf[100];
-
- sprintf (buf, _("Archive member included "
- "to satisfy reference by file (symbol)\n\n"));
- minfo ("%s", buf);
+ minfo (_("Archive member included to satisfy reference by file (symbol)\n\n"));
header_printed = TRUE;
}
&& bfd_hash_lookup (info->notice_hash, name, FALSE, FALSE) != NULL)
{
if (bfd_is_und_section (section))
- einfo ("%B: reference to %s\n", abfd, name);
+ einfo (_("%B: reference to %s\n"), abfd, name);
else
- einfo ("%B: definition of %s\n", abfd, name);
+ einfo (_("%B: definition of %s\n"), abfd, name);
}
if (command_line.cref || nocrossref_list != NULL)