struct option *longopts;
struct option *really_longopts;
int last_optind;
- enum report_method how_to_report_unresolved_symbols = RM_GENERATE_ERROR;
enum symbolic_enum
{
symbolic_unset = 0,
link_info.keep_memory = FALSE;
break;
case OPTION_NO_UNDEFINED:
- link_info.unresolved_syms_in_objects
- = how_to_report_unresolved_symbols;
+ link_info.unresolved_syms_in_objects = RM_DIAGNOSE;
break;
case OPTION_ALLOW_SHLIB_UNDEFINED:
link_info.unresolved_syms_in_shared_libs = RM_IGNORE;
break;
case OPTION_NO_ALLOW_SHLIB_UNDEFINED:
- link_info.unresolved_syms_in_shared_libs
- = how_to_report_unresolved_symbols;
+ link_info.unresolved_syms_in_shared_libs = RM_DIAGNOSE;
break;
case OPTION_UNRESOLVED_SYMBOLS:
if (strcmp (optarg, "ignore-all") == 0)
}
else if (strcmp (optarg, "report-all") == 0)
{
- link_info.unresolved_syms_in_objects
- = how_to_report_unresolved_symbols;
- link_info.unresolved_syms_in_shared_libs
- = how_to_report_unresolved_symbols;
+ link_info.unresolved_syms_in_objects = RM_DIAGNOSE;
+ link_info.unresolved_syms_in_shared_libs = RM_DIAGNOSE;
}
else if (strcmp (optarg, "ignore-in-object-files") == 0)
{
link_info.unresolved_syms_in_objects = RM_IGNORE;
- link_info.unresolved_syms_in_shared_libs
- = how_to_report_unresolved_symbols;
+ link_info.unresolved_syms_in_shared_libs = RM_DIAGNOSE;
}
else if (strcmp (optarg, "ignore-in-shared-libs") == 0)
{
- link_info.unresolved_syms_in_objects
- = how_to_report_unresolved_symbols;
+ link_info.unresolved_syms_in_objects = RM_DIAGNOSE;
link_info.unresolved_syms_in_shared_libs = RM_IGNORE;
}
else
einfo (_("%F%P: bad --unresolved-symbols option: %s\n"), optarg);
break;
case OPTION_WARN_UNRESOLVED_SYMBOLS:
- how_to_report_unresolved_symbols = RM_GENERATE_WARNING;
- if (link_info.unresolved_syms_in_objects == RM_GENERATE_ERROR)
- link_info.unresolved_syms_in_objects = RM_GENERATE_WARNING;
- if (link_info.unresolved_syms_in_shared_libs == RM_GENERATE_ERROR)
- link_info.unresolved_syms_in_shared_libs = RM_GENERATE_WARNING;
+ link_info.warn_unresolved_syms = TRUE;
break;
-
case OPTION_ERROR_UNRESOLVED_SYMBOLS:
- how_to_report_unresolved_symbols = RM_GENERATE_ERROR;
- if (link_info.unresolved_syms_in_objects == RM_GENERATE_WARNING)
- link_info.unresolved_syms_in_objects = RM_GENERATE_ERROR;
- if (link_info.unresolved_syms_in_shared_libs == RM_GENERATE_WARNING)
- link_info.unresolved_syms_in_shared_libs = RM_GENERATE_ERROR;
+ link_info.warn_unresolved_syms = FALSE;
break;
case OPTION_ALLOW_MULTIPLE_DEFINITION:
link_info.allow_multiple_definition = TRUE;
break;
case OPTION_DYNAMIC_LIST_DATA:
opt_dynamic_list = dynamic_list_data;
- if (opt_symbolic == symbolic)
- opt_symbolic = symbolic_unset;
break;
case OPTION_DYNAMIC_LIST_CPP_TYPEINFO:
lang_append_dynamic_list_cpp_typeinfo ();
if (opt_dynamic_list != dynamic_list_data)
opt_dynamic_list = dynamic_list;
- if (opt_symbolic == symbolic)
- opt_symbolic = symbolic_unset;
break;
case OPTION_DYNAMIC_LIST_CPP_NEW:
lang_append_dynamic_list_cpp_new ();
if (opt_dynamic_list != dynamic_list_data)
opt_dynamic_list = dynamic_list;
- if (opt_symbolic == symbolic)
- opt_symbolic = symbolic_unset;
break;
case OPTION_DYNAMIC_LIST:
/* This option indicates a small script that only specifies
}
if (opt_dynamic_list != dynamic_list_data)
opt_dynamic_list = dynamic_list;
- if (opt_symbolic == symbolic)
- opt_symbolic = symbolic_unset;
break;
case OPTION_WARN_COMMON:
config.warn_common = TRUE;
case 'Y':
if (CONST_STRNEQ (optarg, "P,"))
optarg += 2;
- if (default_dirlist != NULL)
- free (default_dirlist);
+ free (default_dirlist);
default_dirlist = xstrdup (optarg);
break;
case 'y':
if (link_info.unresolved_syms_in_objects == RM_NOT_YET_SET)
/* FIXME: Should we allow emulations a chance to set this ? */
- link_info.unresolved_syms_in_objects = how_to_report_unresolved_symbols;
+ link_info.unresolved_syms_in_objects = RM_DIAGNOSE;
if (link_info.unresolved_syms_in_shared_libs == RM_NOT_YET_SET)
/* FIXME: Should we allow emulations a chance to set this ? */
- link_info.unresolved_syms_in_shared_libs = how_to_report_unresolved_symbols;
+ link_info.unresolved_syms_in_shared_libs = RM_DIAGNOSE;
if (bfd_link_relocatable (&link_info)
&& command_line.check_section_addresses < 0)
command_line.check_section_addresses = 0;
+ switch (opt_dynamic_list)
+ {
+ case dynamic_list_unset:
+ break;
+ case dynamic_list_data:
+ link_info.dynamic_data = TRUE;
+ /* Fall through. */
+ case dynamic_list:
+ link_info.dynamic = TRUE;
+ opt_symbolic = symbolic_unset;
+ break;
+ }
+
/* -Bsymbolic and -Bsymbols-functions are for shared library output. */
if (bfd_link_dll (&link_info))
switch (opt_symbolic)
free (link_info.dynamic_list);
link_info.dynamic_list = NULL;
}
- opt_dynamic_list = dynamic_list_unset;
break;
case symbolic_functions:
- opt_dynamic_list = dynamic_list_data;
+ link_info.dynamic = TRUE;
+ link_info.dynamic_data = TRUE;
break;
}
- switch (opt_dynamic_list)
- {
- case dynamic_list_unset:
- break;
- case dynamic_list_data:
- link_info.dynamic_data = TRUE;
- /* Fall through. */
- case dynamic_list:
- link_info.dynamic = TRUE;
- break;
- }
-
if (!bfd_link_dll (&link_info))
{
if (command_line.filter_shlib)
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"));
+ --hash-style=STYLE Set hash style to sysv/gnu/both. Default: "));
+ if (DEFAULT_EMIT_SYSV_HASH)
+ {
+ /* Note - these strings are not translated as
+ they are keywords not descriptive text. */
+ if (DEFAULT_EMIT_GNU_HASH)
+ fprintf (file, "both\n");
+ else
+ fprintf (file, "sysv\n");
+ }
+ else
+ {
+ if (DEFAULT_EMIT_GNU_HASH)
+ fprintf (file, "gnu\n");
+ else
+ /* FIXME: Can this happen ? */
+ fprintf (file, "none\n");
+ }
fprintf (file, _("\
-P AUDITLIB, --depaudit=AUDITLIB\n" "\
Specify a library to use for auditing dependencies\n"));