* emulparams/elf64btsmip.sh: n64 replaces .reginfo with .MIPS.options.
[deliverable/binutils-gdb.git] / ld / lexsup.c
index b9b74bdf0b2aa1847927929c31fc08d99ec0ae9f..230dd6bb55b8c87e1c131475cc5ef4437739518c 100644 (file)
@@ -1,6 +1,6 @@
 /* Parse options for the GNU linker.
    Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001
+   2001, 2002
    Free Software Foundation, Inc.
 
 This file is part of GLD, the Gnu Linker.
@@ -53,10 +53,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #define        S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
 #endif
 
-/* Omit args to avoid the possibility of clashing with a system header
-   that might disagree about consts.  */
-unsigned long strtoul ();
-
 static int is_num PARAMS ((const char *, int, int, int));
 static void set_default_dirlist PARAMS ((char *dirlist_ptr));
 static void set_section_start PARAMS ((char *sect, char *valstr));
@@ -542,7 +538,7 @@ parse_args (argc, argv)
   last_optind = -1;
   while (1)
     {
-      int longind, errind;
+      int longind;
       int optc;
 
       /* Using last_optind lets us avoid calling ldemul_parse_args
@@ -552,21 +548,18 @@ parse_args (argc, argv)
         -nx, in which the -n is parsed as a single option, and we
         loop around to pick up the -x.  */
       if (optind != last_optind)
-       {
-         if (ldemul_parse_args (argc, argv))
-           continue;
-         last_optind = optind;
-       }
+       if (ldemul_parse_args (argc, argv))
+         continue;
 
       /* getopt_long_only is like getopt_long, but '-' as well as '--'
         can indicate a long option.  */
       opterr = 0;
-      errind = optind;
+      last_optind = optind;
       optc = getopt_long_only (argc, argv, shortopts, longopts, &longind);
       if (optc == '?')
        {
-         --optind;
-         optc = getopt_long (argc, argv, shortopts, really_longopts, &longind);
+         optind = last_optind;
+         optc = getopt_long (argc, argv, "-", really_longopts, &longind);
        }
 
       if (optc == -1)
@@ -575,7 +568,7 @@ parse_args (argc, argv)
       switch (optc)
        {
        case '?':
-         einfo (_("%P: unrecognized option '%s'\n"), argv[errind]);
+         einfo (_("%P: unrecognized option '%s'\n"), argv[last_optind]);
        default:
          einfo (_("%P%F: use the --help option for usage information\n"));
 
This page took 0.033144 seconds and 4 git commands to generate.