/* Parse options for the GNU linker.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU Binutils.
'd', NULL, N_("Force common symbols to be defined"), ONE_DASH },
{ {"dp", no_argument, NULL, 'd'},
'\0', NULL, NULL, ONE_DASH },
+ { {"force-group-allocation", no_argument, NULL,
+ OPTION_FORCE_GROUP_ALLOCATION},
+ '\0', NULL, N_("Force group members out of groups"), TWO_DASHES },
{ {"entry", required_argument, NULL, 'e'},
'e', N_("ADDRESS"), N_("Set start address"), TWO_DASHES },
{ {"export-dynamic", no_argument, NULL, OPTION_EXPORT_DYNAMIC},
'o', N_("FILE"), N_("Set output file name"), EXACTLY_TWO_DASHES },
{ {NULL, required_argument, NULL, '\0'},
'O', NULL, N_("Optimize output file"), ONE_DASH },
+ { {"out-implib", required_argument, NULL, OPTION_OUT_IMPLIB},
+ '\0', N_("FILE"), N_("Generate import library"), TWO_DASHES },
#ifdef ENABLE_PLUGINS
{ {"plugin", required_argument, NULL, OPTION_PLUGIN},
'\0', N_("PLUGIN"), N_("Load named plugin"), ONE_DASH },
{ {"no-print-gc-sections", no_argument, NULL, OPTION_NO_PRINT_GC_SECTIONS},
'\0', NULL, N_("Do not list removed unused sections"),
TWO_DASHES },
+ { {"gc-keep-exported", no_argument, NULL, OPTION_GC_KEEP_EXPORTED},
+ '\0', NULL, N_("Keep exported symbols when removing unused sections"),
+ TWO_DASHES },
{ {"hash-size=<NUMBER>", required_argument, NULL, OPTION_HASH_SIZE},
'\0', NULL, N_("Set default hash table size close to <NUMBER>"),
TWO_DASHES },
default:
einfo (_("%P%F: use the --help option for usage information\n"));
+ break;
case 1: /* File name. */
lang_add_input_file (optarg, lang_input_file_is_file_enum, NULL);
case 'd':
command_line.force_common_definition = TRUE;
break;
+ case OPTION_FORCE_GROUP_ALLOCATION:
+ command_line.force_group_allocation = TRUE;
+ break;
case OPTION_DEFSYM:
lex_string = optarg;
lex_redirect (optarg, "--defsym", ++defsym_count);
if (command_line.auxiliary_filters == NULL)
{
command_line.auxiliary_filters = (char **)
- xmalloc (2 * sizeof (char *));
+ xmalloc (2 * sizeof (char *));
command_line.auxiliary_filters[0] = optarg;
command_line.auxiliary_filters[1] = NULL;
}
for (p = command_line.auxiliary_filters; *p != NULL; p++)
++c;
command_line.auxiliary_filters = (char **)
- xrealloc (command_line.auxiliary_filters,
- (c + 2) * sizeof (char *));
+ xrealloc (command_line.auxiliary_filters,
+ (c + 2) * sizeof (char *));
command_line.auxiliary_filters[c] = optarg;
command_line.auxiliary_filters[c + 1] = NULL;
}
case OPTION_PRINT_GC_SECTIONS:
link_info.print_gc_sections = TRUE;
break;
+ case OPTION_GC_KEEP_EXPORTED:
+ link_info.gc_keep_exported = TRUE;
+ break;
case OPTION_HELP:
help ();
xexit (0);
input_flags.dynamic = FALSE;
break;
case OPTION_NO_DEFINE_COMMON:
- command_line.inhibit_common_definition = TRUE;
+ link_info.inhibit_common_definition = TRUE;
break;
case OPTION_NO_DEMANGLE:
demangling = FALSE;
link_info.unresolved_syms_in_shared_libs
= how_to_report_unresolved_symbols;
}
- else if (strcmp (optarg, "ignore-in-shared-libs") == 0)
+ else if (strcmp (optarg, "ignore-in-shared-libs") == 0)
{
link_info.unresolved_syms_in_objects
= how_to_report_unresolved_symbols;
case OPTION_OFORMAT:
lang_add_output_format (optarg, NULL, NULL, 0);
break;
+ case OPTION_OUT_IMPLIB:
+ command_line.out_implib_filename = xstrdup (optarg);
+ break;
case OPTION_PRINT_SYSROOT:
if (*ld_sysroot)
puts (ld_sysroot);
char *buf;
buf = (char *) xmalloc (strlen (command_line.rpath_link)
- + strlen (optarg)
- + 2);
+ + strlen (optarg)
+ + 2);
sprintf (buf, "%s%c%s", command_line.rpath_link,
config.rpath_separator, optarg);
free (command_line.rpath_link);
case OPTION_SORT_COMMON:
if (optarg == NULL
|| strcmp (optarg, N_("descending")) == 0)
- config.sort_common = sort_descending;
- else if (strcmp (optarg, N_("ascending")) == 0)
+ config.sort_common = sort_descending;
+ else if (strcmp (optarg, N_("ascending")) == 0)
config.sort_common = sort_ascending;
else
einfo (_("%P%F: invalid common section sorting option: %s\n"),
break;
case OPTION_TASK_LINK:
link_info.task_link = TRUE;
- /* Fall through - do an implied -r option. */
+ /* Fall through. */
case OPTION_UR:
if (bfd_link_pic (&link_info))
einfo (_("%P%F: -r and %s may not be used together\n"),
case 'u':
ldlang_add_undef (optarg, TRUE);
break;
- case OPTION_REQUIRE_DEFINED_SYMBOL:
- ldlang_add_require_defined (optarg);
+ case OPTION_REQUIRE_DEFINED_SYMBOL:
+ ldlang_add_require_defined (optarg);
break;
case OPTION_UNIQUE:
if (optarg != NULL)
config.hash_table_size = 1021;
break;
- case OPTION_HASH_SIZE:
+ case OPTION_HASH_SIZE:
{
bfd_size_type new_size;
- new_size = strtoul (optarg, NULL, 0);
- if (new_size)
- config.hash_table_size = new_size;
- else
- einfo (_("%P%X: --hash-size needs a numeric argument\n"));
- }
- break;
+ new_size = strtoul (optarg, NULL, 0);
+ if (new_size)
+ config.hash_table_size = new_size;
+ else
+ einfo (_("%P%X: --hash-size needs a numeric argument\n"));
+ }
+ break;
case OPTION_PUSH_STATE:
input_flags.pushed = xmemdup (&input_flags,
break;
case dynamic_list_data:
link_info.dynamic_data = TRUE;
+ /* Fall through. */
case dynamic_list:
link_info.dynamic = TRUE;
break;
fprintf (file, _("\
--eh-frame-hdr Create .eh_frame_hdr section\n"));
fprintf (file, _("\
+ --no-eh-frame-hdr Do not create .eh_frame_hdr section\n"));
+ fprintf (file, _("\
--exclude-libs=LIBS Make all symbols in LIBS hidden\n"));
fprintf (file, _("\
--hash-style=STYLE Set hash style to sysv, gnu or both\n"));
fprintf (file, _("\
-z norelro Don't create RELRO program header (default)\n"));
#endif
+ fprintf (file, _("\
+ -z separate-code Create separate code program header\n"));
+ fprintf (file, _("\
+ -z noseparate-code Don't create separate code program header (default)\n"));
fprintf (file, _("\
-z common Generate common symbols with STT_COMMON type\n"));
fprintf (file, _("\
-z nocommon Generate common symbols with STT_OBJECT type\n"));
fprintf (file, _("\
- -z stacksize=SIZE Set size of stack segment\n"));
+ -z stack-size=SIZE Set size of stack segment\n"));
fprintf (file, _("\
-z text Treat DT_TEXTREL in shared object as error\n"));
fprintf (file, _("\
-z execstack Mark executable as requiring executable stack\n"));
fprintf (file, _("\
-z noexecstack Mark executable as not requiring executable stack\n"));
+ fprintf (file, _("\
+ -z globalaudit Mark executable requiring global auditing\n"));
}
static void