diff options
Diffstat (limited to 'ld/ldmain.c')
-rw-r--r-- | ld/ldmain.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/ld/ldmain.c b/ld/ldmain.c index ee5ab11..d223587 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -50,12 +50,6 @@ #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 @@ -404,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) @@ -539,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); } @@ -805,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 *) @@ -814,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. */ |