aboutsummaryrefslogtreecommitdiff
path: root/ld/lexsup.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2022-10-21 12:20:09 +0100
committerNick Clifton <nickc@redhat.com>2022-10-21 12:20:09 +0100
commit4b2e7a577c2f7311a8c381ff791d46e654c41fcc (patch)
tree04565dd86cf6a87ef1aed4ba39597ac269bf08f6 /ld/lexsup.c
parent816be8d8b71b2b79e348d36d635b9f4756700f94 (diff)
downloadbinutils-4b2e7a577c2f7311a8c381ff791d46e654c41fcc.zip
binutils-4b2e7a577c2f7311a8c381ff791d46e654c41fcc.tar.gz
binutils-4b2e7a577c2f7311a8c381ff791d46e654c41fcc.tar.bz2
Add a -w option to the linker to suppress warning and error messages.
PR 29654 * ld.h (struct ld_config_type): Add no_warnings field. * ldlex.h (enum option_values): Add OPTION_NO_WARNINGS. * lexsup.c (ld_options): Add --no-warnings. (parse_args): Add support for -w and --no-warnings. * ldmisc.c (vfinfo): Return early if the message is a warning and -w has been enabled. * ld.texi (options): Document new command line option. * NEWS: Mention the new feature.
Diffstat (limited to 'ld/lexsup.c')
-rw-r--r--ld/lexsup.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ld/lexsup.c b/ld/lexsup.c
index 0068ff5..d107bd7 100644
--- a/ld/lexsup.c
+++ b/ld/lexsup.c
@@ -381,6 +381,9 @@ static const struct ld_option ld_options[] =
{ {"no-undefined", no_argument, NULL, OPTION_NO_UNDEFINED},
'\0', NULL, N_("Do not allow unresolved references in object files"),
TWO_DASHES },
+ { {"no-warnings", no_argument, NULL, OPTION_NO_WARNINGS},
+ 'w', NULL, N_("Do not display any warning or error messages"),
+ TWO_DASHES },
{ {"allow-shlib-undefined", no_argument, NULL, OPTION_ALLOW_SHLIB_UNDEFINED},
'\0', NULL, N_("Allow unresolved references in shared libraries"),
TWO_DASHES },
@@ -1554,6 +1557,11 @@ parse_args (unsigned argc, char **argv)
case OPTION_NO_WARN_FATAL:
config.fatal_warnings = false;
break;
+ case OPTION_NO_WARNINGS:
+ case 'w':
+ config.no_warnings = true;
+ config.fatal_warnings = false;
+ break;
case OPTION_WARN_MULTIPLE_GP:
config.warn_multiple_gp = true;
break;