aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2022-10-13 19:06:43 -0700
committerFangrui Song <i@maskray.me>2022-10-13 19:06:43 -0700
commit27fb6a1a7fcd047e7d01bef8e3c12ed67bc7aed0 (patch)
tree1020eb9de30900384f996b4fd43c2af00ed8b6de /ld
parent091782c46d9b321f5b7c5e5330b5febe015d73d6 (diff)
downloadgdb-27fb6a1a7fcd047e7d01bef8e3c12ed67bc7aed0.zip
gdb-27fb6a1a7fcd047e7d01bef8e3c12ed67bc7aed0.tar.gz
gdb-27fb6a1a7fcd047e7d01bef8e3c12ed67bc7aed0.tar.bz2
ld: Add --undefined-version
This cancels a previous --no-undefined-version. gold has had --undefined-version for a long time.
Diffstat (limited to 'ld')
-rw-r--r--ld/ldlex.h1
-rw-r--r--ld/lexsup.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/ld/ldlex.h b/ld/ldlex.h
index 57ade1f..8945825 100644
--- a/ld/ldlex.h
+++ b/ld/ldlex.h
@@ -120,6 +120,7 @@ enum option_values
#if SUPPORT_ERROR_HANDLING_SCRIPT
OPTION_ERROR_HANDLING_SCRIPT,
#endif
+ OPTION_UNDEFINED_VERSION,
OPTION_NO_UNDEFINED_VERSION,
OPTION_DEFAULT_SYMVER,
OPTION_DEFAULT_IMPORTED_SYMVER,
diff --git a/ld/lexsup.c b/ld/lexsup.c
index 0c01c99..0068ff5 100644
--- a/ld/lexsup.c
+++ b/ld/lexsup.c
@@ -396,6 +396,8 @@ static const struct ld_option ld_options[] =
OPTION_ERROR_HANDLING_SCRIPT},
'\0', N_("SCRIPT"), N_("Provide a script to help with undefined symbol errors"), TWO_DASHES},
#endif
+ { {"undefined-version", no_argument, NULL, OPTION_UNDEFINED_VERSION},
+ '\0', NULL, N_("Allow undefined version"), EXACTLY_TWO_DASHES },
{ {"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},
@@ -1088,6 +1090,9 @@ parse_args (unsigned argc, char **argv)
break;
#endif
+ case OPTION_UNDEFINED_VERSION:
+ link_info.allow_undefined_version = true;
+ break;
case OPTION_NO_UNDEFINED_VERSION:
link_info.allow_undefined_version = false;
break;