diff options
author | Nick Clifton <nickc@redhat.com> | 2001-08-12 07:59:28 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2001-08-12 07:59:28 +0000 |
commit | b9a8de1ea39d0e4fb34407388382f192f2304e80 (patch) | |
tree | d67bc37e72469440c1f145f88445709618c006f5 /ld/ldmain.c | |
parent | 6ca173e32ce4933fec50f130d36dd07e20391af5 (diff) | |
download | fsf-binutils-gdb-b9a8de1ea39d0e4fb34407388382f192f2304e80.zip fsf-binutils-gdb-b9a8de1ea39d0e4fb34407388382f192f2304e80.tar.gz fsf-binutils-gdb-b9a8de1ea39d0e4fb34407388382f192f2304e80.tar.bz2 |
Make --verbose always display linker script
Diffstat (limited to 'ld/ldmain.c')
-rw-r--r-- | ld/ldmain.c | 47 |
1 files changed, 36 insertions, 11 deletions
diff --git a/ld/ldmain.c b/ld/ldmain.c index 7a450e8..849e0ae 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -296,23 +296,17 @@ main (argc, argv) the -L's in argv have been processed. */ set_scripts_dir (); - if (had_script == false) + /* If we have not already opened and parsed a linker script + read the emulation's appropriate default script. */ + if (saved_script_handle == false) { - /* Read the emulation's appropriate default script. */ int isfile; - char *s = ldemul_get_script (&isfile); + char *s = ldemul_get_script (& isfile); if (isfile) ldfile_open_command_file (s); else - { - if (trace_file_tries) - { - info_msg (_("using internal linker script:\n")); - info_msg ("==================================================\n"); - info_msg (s); - info_msg ("\n==================================================\n"); - } + { lex_string = s; lex_redirect (s); } @@ -321,6 +315,37 @@ main (argc, argv) lex_string = NULL; } + if (trace_file_tries) + { + info_msg (_("using %s linker script:\n"), + saved_script_handle ? "external" : "internal"); + info_msg ("==================================================\n"); + + if (saved_script_handle) + { + const int BSIZE = 8192; + size_t n; + char *buf = xmalloc (BSIZE); + + rewind (saved_script_handle); + while ((n = fread (buf, 1, BSIZE - 1, saved_script_handle)) > 0) + { + buf [n] = 0; + info_msg (buf); + } + rewind (saved_script_handle); + free (buf); + } + else + { + int isfile; + + info_msg (ldemul_get_script (& isfile)); + } + + info_msg ("\n==================================================\n"); + } + lang_final (); if (lang_has_input_file == false) |