This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Empty SONAME bis

How about this patch which also warns about an empty SONAME following a
real SONAME which is what Nick said he agreed with.  As I replied when
Alan commented on the late detection of the problem, I think that we
should not spit out warnings unless they are necessary and that means
delaying the warning until the end.  I've seen horrible scripts which
create these kind of problems.

2014-06-26  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.

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)
 	case 'h':		/* Used on Solaris.  */
-	  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;
 	  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 ();

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]