aboutsummaryrefslogtreecommitdiff
path: root/ld/lexsup.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2014-06-30 06:58:52 -0400
committerUlrich Drepper <drepper@gmail.com>2014-06-30 06:58:52 -0400
commitb00548197542a46df0e46d848ac61a00827943ea (patch)
treec24b9036edcf04bb896767ad0ca0be947d1784b9 /ld/lexsup.c
parent3f201179cc5fe9c0b338fd545d26d1e2ed434f22 (diff)
downloadgdb-b00548197542a46df0e46d848ac61a00827943ea.zip
gdb-b00548197542a46df0e46d848ac61a00827943ea.tar.gz
gdb-b00548197542a46df0e46d848ac61a00827943ea.tar.bz2
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.
Diffstat (limited to 'ld/lexsup.c')
-rw-r--r--ld/lexsup.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/ld/lexsup.c b/ld/lexsup.c
index a8c57d2..52b4fdb 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 ();