* ldmain.c ldmain.h ldgram.y: If -v -V or --version was given,
authorDavid MacKenzie <djm@cygnus>
Thu, 27 Jan 1994 20:49:21 +0000 (20:49 +0000)
committerDavid MacKenzie <djm@cygnus>
Thu, 27 Jan 1994 20:49:21 +0000 (20:49 +0000)
exit successfully instead of complaining if no input files are
given.

ld/ChangeLog
ld/ldgram.y
ld/ldmain.c

index 57791fdb9297b7ad7e48dd9e115974b2c978c4c0..f51ca012b60966ed61e78c0edb91fb5be3f43f23 100644 (file)
@@ -1,3 +1,9 @@
+Thu Jan 27 12:35:01 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
+
+       * ldmain.c ldmain.h ldgram.y: If -v -V or --version was given, 
+       exit successfully instead of complaining if no input files are
+       given. 
+
 Tue Jan 25 13:19:41 1994  Stan Shebs  (shebs@andros.cygnus.com)
 
        * Makefile.in: Format variable definitions consistently.
index b66a099848a870e3c25a22d34d17ba6077885213..dc196aec37d188d331d0ce038a781f12c8243bab 100644 (file)
@@ -118,14 +118,14 @@ static int error_index;
 %token NAME DEFINED TARGET_K SEARCH_DIR MAP ENTRY 
 %token OPTION_e OPTION_c OPTION_noinhibit_exec OPTION_s OPTION_S OPTION_sort_common OPTION_warn_common
 %token OPTION_EB OPTION_EL OPTION_G OPTION_Gval OPTION_help
-%token OPTION_format OPTION_oformat  OPTION_F OPTION_u OPTION_Bstatic OPTION_N
+%token OPTION_format OPTION_oformat  OPTION_F OPTION_u OPTION_y OPTION_Bstatic OPTION_N
 %token <integer> SIZEOF NEXT ADDR 
 %token OPTION_d OPTION_dc OPTION_dp OPTION_x OPTION_X OPTION_defsym
 %token OPTION_v OPTION_V OPTION_m OPTION_memul OPTION_M OPTION_t STARTUP HLL SYSLIB FLOAT  NOFLOAT 
 %token OPTION_L OPTION_Map
 %token OPTION_n OPTION_r OPTION_o OPTION_b  OPTION_R OPTION_relax OPTION_version
 %token <name> OPTION_l OPTION_Lfile OPTION_T OPTION_Aarch OPTION_Tfile
-%token <name> OPTION_Texp OPTION_y
+%token <name> OPTION_Texp OPTION_esymbol OPTION_usymbol OPTION_ysymbol
 %token OPTION_Ur 
 %token ORIGIN FILL OPTION_g
 %token LENGTH    CREATE_OBJECT_SYMBOLS INPUT OUTPUT  CONSTRUCTORS
@@ -165,16 +165,18 @@ command_line_option:
        |       OPTION_v
                        {       
                        ldversion(0);
+                       version_printed = true;
                        }
        |       OPTION_V
                        {       
                        ldversion(1);
+                       version_printed = true;
                        trace_file_tries = true;
                        }
        |       OPTION_version
                        {       
                        ldversion(0);
-                       exit(0);
+                       version_printed = true;
                        }
        |       OPTION_t {
                        trace_files = true;
@@ -218,6 +220,9 @@ command_line_option:
         |       OPTION_u NAME {
                        ldlang_add_undef($2);
                }
+        |       OPTION_usymbol {
+                       ldlang_add_undef($1);
+               }
        |       OPTION_r {
                        link_info.relocateable = true;
                        config.build_constructors = false;
@@ -237,6 +242,9 @@ command_line_option:
        |       OPTION_e NAME
                        { lang_add_entry($2); 
                        }
+       |       OPTION_esymbol
+                       { lang_add_entry($1); 
+                       }
        |       OPTION_X {
                        link_info.discard = discard_l;
                }
@@ -292,7 +300,11 @@ command_line_option:
                        lang_section_start($1,exp_intop($3));
                        hex_mode = 0; 
                }
-       |       OPTION_y
+       |       OPTION_y NAME
+                       {
+                       add_ysym($2);
+                       }
+       |       OPTION_ysymbol
                        {
                        add_ysym($1);
                        }
index 4eb5fce08382406e6768aeb71db7eb6da6f00ba5..403d0288692d0831db5230861c984411fe47491d 100644 (file)
@@ -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");
     }