From b00548197542a46df0e46d848ac61a00827943ea Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 30 Jun 2014 06:58:52 -0400 Subject: [PATCH] lexsup.c (parse_args): Check whether provided SONAME is empty string. If yes, warn and ignore it. Don't overwrite valid SONAME with empty string. --- ld/ChangeLog | 6 ++++++ ld/lexsup.c | 12 +++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index f42d00bf1a0..a903fc05968 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,9 @@ +2014-06-30 Ulrich Drepper + + * lexsup.c (parse_args): Check whether provided SONAME is empty + string. If yes, warn and ignore it. Don't overwrite valid SONAME + with empty string. + 2014-06-26 Linda Zhang * emultempl/pe.em: Initialise insert_timestamp to true. diff --git a/ld/lexsup.c b/ld/lexsup.c index a8c57d270b0..52b4fdb565c 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c @@ -1107,7 +1107,11 @@ parse_args (unsigned argc, char **argv) break; case 'h': /* Used on Solaris. */ case OPTION_SONAME: - command_line.soname = optarg; + if (optarg[0] == '\0' && command_line.soname + && command_line.soname[0]) + einfo (_("%P: SONAME must not be empty string; keeping previous one\n")); + else + command_line.soname = optarg; break; case OPTION_SORT_COMMON: if (optarg == NULL @@ -1443,6 +1447,12 @@ parse_args (unsigned argc, char **argv) } } + if (command_line.soname && command_line.soname[0] == '\0') + { + einfo (_("%P: SONAME must not be empty string; ignored\n")); + command_line.soname = NULL; + } + while (ingroup) { lang_leave_group (); -- 2.30.2