Fix problems with new EXACTLY_TWO_DASHES command line switch option.
authorNick Clifton <nickc@redhat.com>
Sun, 31 Dec 2000 19:56:04 +0000 (19:56 +0000)
committerNick Clifton <nickc@redhat.com>
Sun, 31 Dec 2000 19:56:04 +0000 (19:56 +0000)
ld/ChangeLog
ld/lexsup.c
ld/testsuite/ChangeLog
ld/testsuite/ld-srec/srec.exp

index 2e1b4169e46a9a4b0ab137525d7c30dd4cba960f..18222733a429a8af3ddfe5bb7c9d622c4005871c 100644 (file)
@@ -1,3 +1,8 @@
+2000-12-31  Nick Clifton  <nickc@redhat.com>
+
+       * lexsup.c (parse_args): Set opterr to 0 and detect unparsed long
+       options by checking for a return value of '?' not -1.
+
 2000-12-28  Nick Clifton  <nickc@redhat.com>
 
        * lexsup.c (struct ld_option): Add new enum value:
index eb1fc2d86dda7582e799348cee578a1f395d6f16..80ccc6e0e2de5d473264b59648793ca7546478da 100644 (file)
@@ -543,14 +543,22 @@ parse_args (argc, argv)
 
       /* getopt_long_only is like getopt_long, but '-' as well as '--'
         can indicate a long option.  */
+      opterr = 0;
       optc = getopt_long_only (argc, argv, shortopts, longopts, &longind);
-      if (optc == -1)
-       optc = getopt_long (argc, argv, shortopts, really_longopts, &longind);
-
+      if (optc == '?')
+       {
+         --optind;
+         optc = getopt_long (argc, argv, shortopts, really_longopts, &longind);
+       }
+  
       if (optc == -1)
        break;
+
       switch (optc)
        {
+       case '?':
+         fprintf (stderr, _("%s: unrecognized option '%s'\n"),
+                  program_name, argv[optind - 1]);
        default:
          fprintf (stderr,
                   _("%s: use the --help option for usage information\n"),
index feca9e11d4aea6fdd840f8ea6e2ec65c8f3011af..192e265c550619f84d6f33cf93059a8fa43f75a3 100644 (file)
@@ -1,3 +1,7 @@
+2000-12-31  Nick Clifton  <nickc@redhat.com>
+
+       * ld-srec/srec.exp: Use --oformat instead of -oformat.
+
 2000-12-09  Nick Clifton  <nickc@redhat.com>
 
        * ld-selective/selective.exp: Link in libgcc when target is v850.
index 818f847ea0c2a53c3e9cc23730ecd4faa8651d9d..f493f98cc68ae4182f5c2caa74585dd6c8633f64 100644 (file)
@@ -237,7 +237,7 @@ proc run_srec_test { test objs } {
         set flags "$flags --defsym __gccmain=0"
 
         # ARM targets cannot convert format in the linker 
-        # using the -oformat command line switch
+        # using the --oformat command line switch
        setup_xfail "*arm*-*-*"
        setup_xfail "xscale-*-*"
        setup_xfail "thumb-*-*"
@@ -259,7 +259,7 @@ proc run_srec_test { test objs } {
     }
     
     if { ![ld_simple_link $ld tmpdir/sr1 "$flags $objs"] \
-        || ![ld_simple_link $ld tmpdir/sr2.sr "$flags -oformat srec $objs"] } {
+        || ![ld_simple_link $ld tmpdir/sr2.sr "$flags --oformat srec $objs"] } {
        setup_xfail "hppa*-*-*elf*"
        fail $test
        return
This page took 0.031657 seconds and 4 git commands to generate.