* ld-scripts/crossref.exp: Allow foo to have a leading dot.
[deliverable/binutils-gdb.git] / ld / lexsup.c
index a72dfb4576be3806e8a9d9b8707f321c04d1d1ad..ca2e9a1a46cc42e22c37697321b923f85fd4f9ba 100644 (file)
@@ -133,6 +133,7 @@ int parsing_defsym = 0;
 #define OPTION_DISCARD_NONE            (OPTION_ALLOW_SHLIB_UNDEFINED + 1)
 #define OPTION_SPARE_DYNAMIC_TAGS      (OPTION_DISCARD_NONE + 1)
 #define OPTION_NO_DEFINE_COMMON                (OPTION_SPARE_DYNAMIC_TAGS + 1)
+#define OPTION_NOSTDLIB                        (OPTION_NO_DEFINE_COMMON + 1)
 
 /* The long options.  This structure is used for both the option
    parsing and the help text.  */
@@ -204,7 +205,7 @@ static const struct ld_option ld_options[] =
   { {"soname", required_argument, NULL, OPTION_SONAME},
       'h', N_("FILENAME"), N_("Set internal name of shared library"), ONE_DASH },
   { {"dynamic-linker", required_argument, NULL, OPTION_DYNAMIC_LINKER},
-      'I', N_("PROGRAM"), N_("Set the dynamic linker to use"), TWO_DASHES },
+      'I', N_("PROGRAM"), N_("Set PROGRAM as the dynamic linker to use"), TWO_DASHES },
   { {"library", required_argument, NULL, 'l'},
       'l', N_("LIBNAME"), N_("Search for library LIBNAME"), TWO_DASHES },
   { {"library-path", required_argument, NULL, 'L'},
@@ -330,6 +331,8 @@ static const struct ld_option ld_options[] =
       '\0', NULL, N_("Create an output file even if errors occur"), TWO_DASHES },
   { {"noinhibit_exec", no_argument, NULL, OPTION_NOINHIBIT_EXEC},
       '\0', NULL, NULL, NO_HELP },
+  { {"nostdlib", no_argument, NULL, OPTION_NOSTDLIB},
+      '\0', NULL, N_("Only use library directories specified on\n\t\t\t\tthe command line"), ONE_DASH },
   { {"oformat", required_argument, NULL, OPTION_OFORMAT},
       '\0', N_("TARGET"), N_("Specify target of output file"), EXACTLY_TWO_DASHES },
   { {"qmagic", no_argument, NULL, OPTION_IGNORE},
@@ -539,7 +542,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
@@ -549,21 +552,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)
@@ -572,7 +572,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"));
 
@@ -771,6 +771,9 @@ parse_args (argc, argv)
        case OPTION_NOINHIBIT_EXEC:
          force_make_executable = true;
          break;
+       case OPTION_NOSTDLIB:
+         config.only_cmd_line_lib_dirs = true;
+         break;
        case OPTION_NO_WHOLE_ARCHIVE:
          whole_archive = false;
          break;
This page took 0.025323 seconds and 4 git commands to generate.