Correct AArch64 crypto dependencies.
[deliverable/binutils-gdb.git] / ld / ldmain.c
index 045f3231fa235d27fa25533b722e119b561362f3..9e8f3304fe97c1c6979fa50970a99e891040d1fc 100644 (file)
 
 #include <string.h>
 
-#ifdef HAVE_SBRK
-#if !HAVE_DECL_SBRK
-extern void *sbrk ();
-#endif
-#endif
-
 #ifndef TARGET_SYSTEM_ROOT
 #define TARGET_SYSTEM_ROOT ""
 #endif
@@ -198,9 +192,6 @@ main (int argc, char **argv)
 {
   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, "");
@@ -282,7 +273,8 @@ main (int argc, char **argv)
   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
@@ -299,7 +291,7 @@ main (int argc, char **argv)
   link_info.compress_debug = COMPRESS_DEBUG_GABI_ZLIB;
 #endif
 #ifdef DEFAULT_NEW_DTAGS
-  link_info.new_dtags = TRUE;
+  link_info.new_dtags = DEFAULT_NEW_DTAGS;
 #endif
 
   ldfile_add_arch ("");
@@ -386,6 +378,12 @@ main (int argc, char **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 ());
 
@@ -398,6 +396,9 @@ main (int argc, char **argv)
   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)
@@ -533,18 +534,11 @@ main (int argc, char **argv)
 
   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);
     }
 
@@ -799,6 +793,7 @@ add_archive_element (struct bfd_link_info *info,
                     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 *)
@@ -808,6 +803,10 @@ add_archive_element (struct bfd_link_info *info,
   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.  */
@@ -1487,9 +1486,9 @@ notice (struct bfd_link_info *info,
       && 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)
This page took 0.024275 seconds and 4 git commands to generate.