From aa713662e8c8349dbf475437e8db72ffd9a9cc4d Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 22 May 2002 05:08:31 +0000 Subject: 2002-05-21 H.J. Lu (hjl@gnu.org) * emultempl/elf32.em (gld${EMULATION_NAME}_parse_args): Handle "-z muldefs". (gld${EMULATION_NAME}_list_options): Add "-z muldefs". * ld.texinfo: Updated for --allow-multiple-definition and "-z muldefs". * ldmain.c (main): Initialize the allow_multiple_definition field to false. * lexsup.c (OPTION_ALLOW_MULTIPLE_DEFINITION): New. (ld_options): Add --allow-multiple-definition. (parse_args): Support OPTION_ALLOW_MULTIPLE_DEFINITION. --- ld/lexsup.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ld/lexsup.c') diff --git a/ld/lexsup.c b/ld/lexsup.c index cbde50960f7..ddaf692935f 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c @@ -126,7 +126,8 @@ int parsing_defsym = 0; #define OPTION_UNIQUE (OPTION_SECTION_START + 1) #define OPTION_TARGET_HELP (OPTION_UNIQUE + 1) #define OPTION_ALLOW_SHLIB_UNDEFINED (OPTION_TARGET_HELP + 1) -#define OPTION_DISCARD_NONE (OPTION_ALLOW_SHLIB_UNDEFINED + 1) +#define OPTION_ALLOW_MULTIPLE_DEFINITION (OPTION_ALLOW_SHLIB_UNDEFINED + 1) +#define OPTION_DISCARD_NONE (OPTION_ALLOW_MULTIPLE_DEFINITION + 1) #define OPTION_SPARE_DYNAMIC_TAGS (OPTION_DISCARD_NONE + 1) #define OPTION_NO_DEFINE_COMMON (OPTION_SPARE_DYNAMIC_TAGS + 1) #define OPTION_NOSTDLIB (OPTION_NO_DEFINE_COMMON + 1) @@ -319,6 +320,8 @@ static const struct ld_option ld_options[] = '\0', NULL, N_("Allow no undefined symbols"), TWO_DASHES }, { {"allow-shlib-undefined", no_argument, NULL, OPTION_ALLOW_SHLIB_UNDEFINED}, '\0', NULL, N_("Allow undefined symbols in shared objects"), TWO_DASHES }, + { {"allow-multiple-definition", no_argument, NULL, OPTION_ALLOW_MULTIPLE_DEFINITION}, + '\0', NULL, N_("Allow multiple definitions"), TWO_DASHES }, { {"no-warn-mismatch", no_argument, NULL, OPTION_NO_WARN_MISMATCH}, '\0', NULL, N_("Don't warn about mismatched input files"), TWO_DASHES}, { {"no-whole-archive", no_argument, NULL, OPTION_NO_WHOLE_ARCHIVE}, @@ -761,6 +764,9 @@ parse_args (argc, argv) case OPTION_ALLOW_SHLIB_UNDEFINED: link_info.allow_shlib_undefined = true; break; + case OPTION_ALLOW_MULTIPLE_DEFINITION: + link_info.allow_multiple_definition = true; + break; case OPTION_NO_WARN_MISMATCH: command_line.warn_mismatch = false; break; -- cgit v1.2.1