2008-01-29 Ulrich Drepper <drepper@redhat.com>
+ * ld.c (replace_args): New function.
+ (main): Use it to rewrite old-style parameters.
+
* elf32-i386.script: Add .gnu.hash section.
* ldgeneric.c (optimal_bucket_size): A tiny bit more efficient.
(fillin_special_symbol): Initialize st_size.
static const char args_doc[] = N_("[FILE]...");
/* Prototype for option handler. */
+static void replace_args (int argc, char *argv[]);
static error_t parse_opt_1st (int key, char *arg, struct argp_state *state);
static error_t parse_opt_2nd (int key, char *arg, struct argp_state *state);
#define obstack_chunk_free free
obstack_init (&ld_state.smem);
+ /* Recognize old-style parameters for compatibility. */
+ replace_args (argc, argv);
+
/* One quick pass over the parameters which allows us to scan for options
with global effect which influence the rest of the processing. */
argp_parse (&argp_1st, argc, argv, ARGP_IN_ORDER, &remaining, NULL);
}
+static void
+replace_args (int argc, char *argv[])
+{
+ static const struct
+ {
+ const char *from;
+ const char *to;
+ } args[] =
+ {
+ { "-export-dynamic", "--export-dynamic" },
+ { "-dynamic-linker", "--dynamic-linker" }
+ };
+ const size_t nargs = sizeof (args) / sizeof (args[0]);
+
+ for (int i = 1; i < argc; ++i)
+ if (argv[i][0] == '-' && islower (argv[i][1]))
+ for (size_t j = 0; j < nargs; ++j)
+ if (strcmp (argv[i], args[j].from) == 0)
+ {
+ argv[i] = (char *) args[j].to;
+ break;
+ }
+}
+
+
/* Quick scan of the parameter list for options with global effect. */
static error_t
parse_opt_1st (int key, char *arg,