aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-04-09 19:30:06 +0000
committerIan Lance Taylor <ian@airs.com>1996-04-09 19:30:06 +0000
commitbf7198b36cfb1d8a1725d1f67f8d27ba2eb9bf5f (patch)
tree777ee3a3bb7f991178d77cb42b5c549264eb7a83 /ld
parent1ffec9e6066f5f89ca152380e562bb835139ecf8 (diff)
downloadgdb-bf7198b36cfb1d8a1725d1f67f8d27ba2eb9bf5f.zip
gdb-bf7198b36cfb1d8a1725d1f67f8d27ba2eb9bf5f.tar.gz
gdb-bf7198b36cfb1d8a1725d1f67f8d27ba2eb9bf5f.tar.bz2
tweak last change
Diffstat (limited to 'ld')
-rw-r--r--ld/lexsup.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/ld/lexsup.c b/ld/lexsup.c
index e82fda0..85dc568 100644
--- a/ld/lexsup.c
+++ b/ld/lexsup.c
@@ -139,8 +139,8 @@ static const struct ld_option ld_options[] =
'e', "ADDRESS", "Set start address", TWO_DASHES },
{ {"export-dynamic", no_argument, NULL, OPTION_EXPORT_DYNAMIC},
'E', NULL, "Export all dynamic symbols", TWO_DASHES },
- { {NULL, no_argument, NULL, '\0'},
- 'F', NULL, "Ignored", ONE_DASH },
+ { {NULL, optional_argument, NULL, '\0'},
+ 'F', "[FORMAT]", "Ignored", ONE_DASH },
{ {"gpsize", required_argument, NULL, 'G'},
'G', "SIZE", "Small data size (if no size, same as --shared)",
TWO_DASHES },
@@ -308,7 +308,7 @@ parse_args (argc, argv)
int i, is, il;
int ingroup = 0;
char *default_dirlist = NULL;
- char shortopts[OPTION_COUNT * 2 + 2];
+ char shortopts[OPTION_COUNT * 3 + 2];
struct option longopts[OPTION_COUNT + 1];
/* Starting the short option string with '-' is for programs that
@@ -324,10 +324,16 @@ parse_args (argc, argv)
{
shortopts[is] = ld_options[i].shortopt;
++is;
- if (ld_options[i].opt.has_arg == required_argument)
+ if (ld_options[i].opt.has_arg == required_argument
+ || ld_options[i].opt.has_arg == optional_argument)
{
shortopts[is] = ':';
++is;
+ if (ld_options[i].opt.has_arg == optional_argument)
+ {
+ shortopts[is] = ':';
+ ++is;
+ }
}
}
if (ld_options[i].opt.name != NULL)
@@ -798,8 +804,13 @@ help ()
len += (comma ? 2 : 0) + 2;
if (ld_options[j].arg != NULL)
{
- printf (" %s", ld_options[j].arg);
- len += 1 + strlen (ld_options[j].arg);
+ if (ld_options[j].opt.has_arg != optional_argument)
+ {
+ printf (" ");
+ ++len;
+ }
+ printf ("%s", ld_options[j].arg);
+ len += strlen (ld_options[j].arg);
}
comma = true;
}