aboutsummaryrefslogtreecommitdiff
path: root/ld/ldmain.c
diff options
context:
space:
mode:
authorDavid MacKenzie <djm@cygnus>1994-01-27 20:49:21 +0000
committerDavid MacKenzie <djm@cygnus>1994-01-27 20:49:21 +0000
commit7b40f2b16942598c1041724395e4dd20a7b5ec14 (patch)
tree7facff5e2394205e740d7c7970a460c540a9493e /ld/ldmain.c
parenta28d16d3802d751d84566e47fb3b0ffbb28ecf1c (diff)
downloadgdb-7b40f2b16942598c1041724395e4dd20a7b5ec14.zip
gdb-7b40f2b16942598c1041724395e4dd20a7b5ec14.tar.gz
gdb-7b40f2b16942598c1041724395e4dd20a7b5ec14.tar.bz2
* ldmain.c ldmain.h ldgram.y: If -v -V or --version was given,
exit successfully instead of complaining if no input files are given.
Diffstat (limited to 'ld/ldmain.c')
-rw-r--r--ld/ldmain.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ld/ldmain.c b/ld/ldmain.c
index 4eb5fce..403d028 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -67,6 +67,10 @@ boolean trace_files;
/* Nonzero means same, but note open failures, too. */
boolean trace_file_tries;
+/* Nonzero means version number was printed, so exit successfully
+ instead of complaining if no input files are given. */
+boolean version_printed;
+
/* 1 => write load map. */
boolean write_map;
@@ -143,7 +147,7 @@ main (argc, argv)
bfd_init ();
/* Initialize the data about options. */
- trace_files = trace_file_tries = false;
+ trace_files = trace_file_tries = version_printed = false;
write_map = false;
config.build_constructors = true;
command_line.force_common_definition = false;
@@ -208,6 +212,8 @@ main (argc, argv)
if (lang_has_input_file == false)
{
+ if (version_printed)
+ exit (0);
einfo ("%P%F: no input files\n");
}