public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Empty SONAME bis
@ 2014-06-26 17:50 Ulrich Drepper
  2014-06-30  7:50 ` Nicholas Clifton
  0 siblings, 1 reply; 2+ messages in thread
From: Ulrich Drepper @ 2014-06-26 17:50 UTC (permalink / raw)
  To: binutils

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  <drepper@gmail.com>

	* 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)
 	  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 ();

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Empty SONAME bis
  2014-06-26 17:50 Empty SONAME bis Ulrich Drepper
@ 2014-06-30  7:50 ` Nicholas Clifton
  0 siblings, 0 replies; 2+ messages in thread
From: Nicholas Clifton @ 2014-06-30  7:50 UTC (permalink / raw)
  To: Ulrich Drepper, binutils

Hi Uli,

> 2014-06-26  Ulrich Drepper  <drepper@gmail.com>
>
> 	* 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.

Approved - please apply.

Cheers
   Nick

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-06-30  7:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-26 17:50 Empty SONAME bis Ulrich Drepper
2014-06-30  7:50 ` Nicholas Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).