Change the default behaviour of the PE targeted linker so that timestamps are
[binutils-gdb.git] / ld / ldlang.c
index 7c076a2f78d83f8da5543237ad27519c5ed00dea..e7c96696993b3250eae6cc9ad6c5baac1713787f 100644 (file)
@@ -112,8 +112,6 @@ struct asneeded_minfo **asneeded_list_tail;
     DEFINED() need to increment this at the start of the traversal.  */
 int lang_statement_iteration = 0;
 
-etree_type *base; /* Relocation base - or null */
-
 /* Return TRUE if the PATTERN argument is a wildcard pattern.
    Although backslashes are treated specially if a pattern contains
    wildcards, we do not consider the mere presence of a backslash to
@@ -2122,6 +2120,8 @@ lang_map (void)
     }
   lang_statement_iteration++;
   print_statements ();
+
+  ldemul_extra_map_file_text (link_info.output_bfd, &link_info, config.map_file);
 }
 
 static bfd_boolean
@@ -3072,9 +3072,6 @@ lang_get_output_target (void)
   return default_target;
 }
 
-/* Stashed function to free link_info.hash; see open_output.  */
-void (*output_bfd_hash_table_free_fn) (struct bfd_link_hash_table *);
-
 /* Open the output file.  */
 
 static void
@@ -3154,18 +3151,6 @@ open_output (const char *name)
   if (link_info.hash == NULL)
     einfo (_("%P%F: can not create hash table: %E\n"));
 
-  /* We want to please memory leak checkers by deleting link_info.hash.
-     We can't do it in lang_finish, as a bfd target may hold references to
-     symbols in this table and use them when their _bfd_write_contents
-     function is invoked, as part of bfd_close on the output_bfd.  But,
-     output_bfd is deallocated at bfd_close, so we can't refer to
-     output_bfd after that time, and dereferencing it is needed to call
-     "bfd_link_hash_table_free".  Smash this dependency deadlock and grab
-     the function pointer; arrange to call it on link_info.hash in
-     ld_cleanup.  */
-  output_bfd_hash_table_free_fn
-    = link_info.output_bfd->xvec->_bfd_link_hash_table_free;
-
   bfd_set_gp_size (link_info.output_bfd, g_switch_value);
 }
 
@@ -6228,11 +6213,11 @@ ldlang_add_file (lang_input_statement_type *entry)
 
   /* The BFD linker needs to have a list of all input BFDs involved in
      a link.  */
-  ASSERT (entry->the_bfd->link_next == NULL);
+  ASSERT (entry->the_bfd->link.next == NULL);
   ASSERT (entry->the_bfd != link_info.output_bfd);
 
   *link_info.input_bfds_tail = entry->the_bfd;
-  link_info.input_bfds_tail = &entry->the_bfd->link_next;
+  link_info.input_bfds_tail = &entry->the_bfd->link.next;
   entry->the_bfd->usrdata = entry;
   bfd_set_gp_size (entry->the_bfd, g_switch_value);