X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=ld%2Flexsup.c;h=eae64932dfcbeaeec4391fc613bfa459eda56bcb;hb=23ae20f5e3afeeab9aa616c63ab3b357668476d5;hp=58c6c078325b9544a8d60d9598093cbb8ab2806b;hpb=4bf05d4a900ae2c6c59e173340cc087584e46c81;p=deliverable%2Fbinutils-gdb.git diff --git a/ld/lexsup.c b/ld/lexsup.c index 58c6c07832..eae64932df 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c @@ -386,6 +386,11 @@ static const struct ld_option ld_options[] = { {"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}, @@ -530,9 +535,9 @@ static const struct ld_option ld_options[] = { {"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}, @@ -572,6 +577,18 @@ static const struct ld_option ld_options[] = { {"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=", required_argument, NULL, + OPTION_CTF_SHARE_TYPES}, + '\0', NULL, N_("How to share CTF types between translation units.\n" + " is: share-unconflicted (default),\n" + " share-duplicated"), + TWO_DASHES }, }; #define OPTION_COUNT ARRAY_SIZE (ld_options) @@ -605,7 +622,7 @@ parse_args (unsigned argc, char **argv) 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 @@ -723,6 +740,20 @@ parse_args (unsigned argc, char **argv) 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; @@ -1017,6 +1048,15 @@ parse_args (unsigned argc, char **argv) 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; @@ -1637,6 +1677,23 @@ parse_args (unsigned argc, char **argv) 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; } } @@ -2021,6 +2078,10 @@ elf_static_list_options (FILE *file) 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")); }