{ {"allow-multiple-definition", no_argument, NULL,
OPTION_ALLOW_MULTIPLE_DEFINITION},
'\0', NULL, N_("Allow multiple definitions"), TWO_DASHES },
+#if SUPPORT_ERROR_HANDLING_SCRIPT
+ { {"error-handling-script", required_argument, NULL,
+ OPTION_ERROR_HANDLING_SCRIPT},
+ '\0', N_("SCRIPT"), N_("Provide a script to help with undefined symbol errors"), TWO_DASHES},
+#endif
{ {"no-undefined-version", no_argument, NULL, OPTION_NO_UNDEFINED_VERSION},
'\0', NULL, N_("Disallow undefined version"), TWO_DASHES },
{ {"default-symver", no_argument, NULL, OPTION_DEFAULT_SYMVER},
{ {"warn-textrel", no_argument, NULL, OPTION_WARN_TEXTREL},
'\0', NULL,
#if DEFAULT_LD_TEXTREL_CHECK_WARNING
- N_("Warn if outpout has DT_TEXTREL (default)"),
+ N_("Warn if output has DT_TEXTREL (default)"),
#else
- N_("Warn if outpout has DT_TEXTREL"),
+ N_("Warn if output has DT_TEXTREL"),
#endif
TWO_DASHES },
{ {"warn-shared-textrel", no_argument, NULL, OPTION_WARN_TEXTREL},
{ {"no-print-map-discarded", no_argument, NULL, OPTION_NO_PRINT_MAP_DISCARDED},
'\0', NULL, N_("Do not show discarded sections in map file output"),
TWO_DASHES },
+ { {"ctf-variables", no_argument, NULL, OPTION_CTF_VARIABLES},
+ '\0', NULL, N_("Emit names and types of static variables in CTF"),
+ TWO_DASHES },
+ { {"no-ctf-variables", no_argument, NULL, OPTION_NO_CTF_VARIABLES},
+ '\0', NULL, N_("Do not emit names and types of static variables in CTF"),
+ TWO_DASHES },
+ { {"ctf-share-types=<method>", required_argument, NULL,
+ OPTION_CTF_SHARE_TYPES},
+ '\0', NULL, N_("How to share CTF types between translation units.\n"
+ " <method> is: share-unconflicted (default),\n"
+ " share-duplicated"),
+ TWO_DASHES },
};
#define OPTION_COUNT ARRAY_SIZE (ld_options)
longopts = (struct option *)
xmalloc (sizeof (*longopts) * (OPTION_COUNT + 1));
really_longopts = (struct option *)
- malloc (sizeof (*really_longopts) * (OPTION_COUNT + 1));
+ xmalloc (sizeof (*really_longopts) * (OPTION_COUNT + 1));
/* Starting the short option string with '-' is for programs that
expect options and other ARGV-elements in any order and that care about
optind = last_optind;
optc = getopt_long (argc, argv, "-", really_longopts, &longind);
}
+ /* Attempt to detect grouped short options, eg: "-non-start".
+ Accepting such options is error prone as it is not clear if the user
+ intended "-n -o n-start" or "--non-start". */
+ else if (longind == 0 /* This is a short option. */
+ && optc > 32 /* It is a valid option. */
+ /* The character is not the second character of argv[last_optind]. */
+ && optc != argv[last_optind][1])
+ {
+ if (optarg)
+ einfo (_("%F%P: Error: unable to disambiguate: %s (did you mean -%s ?)\n"),
+ argv[last_optind], argv[last_optind]);
+ else
+ einfo (_("%P: Warning: grouped short command line options are deprecated: %s\n"), argv[last_optind]);
+ }
if (ldemul_handle_option (optc))
continue;
case OPTION_ALLOW_MULTIPLE_DEFINITION:
link_info.allow_multiple_definition = TRUE;
break;
+
+#if SUPPORT_ERROR_HANDLING_SCRIPT
+ case OPTION_ERROR_HANDLING_SCRIPT:
+ /* FIXME: Should we warn if the script is being overridden by another ?
+ Or maybe they should be chained together ? */
+ error_handling_script = optarg;
+ break;
+#endif
+
case OPTION_NO_UNDEFINED_VERSION:
link_info.allow_undefined_version = FALSE;
break;
case OPTION_DEPENDENCY_FILE:
config.dependency_file = optarg;
break;
+
+ case OPTION_CTF_VARIABLES:
+ config.ctf_variables = TRUE;
+ break;
+
+ case OPTION_NO_CTF_VARIABLES:
+ config.ctf_variables = FALSE;
+ break;
+
+ case OPTION_CTF_SHARE_TYPES:
+ if (strcmp (optarg, "share-unconflicted") == 0)
+ config.ctf_share_duplicated = FALSE;
+ else if (strcmp (optarg, "share-duplicated") == 0)
+ config.ctf_share_duplicated = TRUE;
+ else
+ einfo (_("%F%P: bad --ctf-share-types option: %s\n"), optarg);
+ break;
}
}
fprintf (file, _("\
-z noexecstack Mark executable as not requiring executable stack\n"));
fprintf (file, _("\
+ -z unique-symbol Avoid duplicated local symbol names\n"));
+ fprintf (file, _("\
+ -z nounique-symbol Keep duplicated local symbol names (default)\n"));
+ fprintf (file, _("\
-z globalaudit Mark executable requiring global auditing\n"));
}