public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Re: Empty SONAME
       [not found] <8761jrvo5z.fsf@x240.local.i-did-not-set--mail-host-address--so-tickle-me>
@ 2014-06-24 11:40 ` Alan Modra
  2014-06-24 11:46   ` Ulrich Drepper
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Modra @ 2014-06-24 11:40 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: binutils

On Mon, Jun 23, 2014 at 07:52:08AM -0400, Ulrich Drepper wrote:
> It makes no sense to create DSOs with empty SONAMEs.  This can only
> create problems when trying to use those DSOs later on.  So, let's just
> avoid creating them in the first place.
> 
> The patch below does not handle this as an error.  It causes ld to print
> a message and then ignore the provided string.
> 
> OK to check in?

I think it would be better to check for and warn about an empty string
at "case OPTION_SONAME:", as is done for most other errors.  If you do
it that way you can actually do as your warning message says,
ie. ignore the option, without changing comand_line.soname.

> 
> 2014-06-23  Ulrich Drepper  <drepper@gmail.com>
> 
> 	* lexsup.c (parse_args): Check whether provided SONAME is empty
> 	string.  If yes, warn and ignore it.
> 
>  
> diff --git a/ld/lexsup.c b/ld/lexsup.c
> index a8c57d2..35657c0 100644
> --- a/ld/lexsup.c
> +++ b/ld/lexsup.c
> @@ -1443,6 +1443,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 ();

-- 
Alan Modra
Australia Development Lab, IBM

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

* Re: Empty SONAME
  2014-06-24 11:40 ` Empty SONAME Alan Modra
@ 2014-06-24 11:46   ` Ulrich Drepper
  2014-06-26 12:26     ` Nicholas Clifton
  0 siblings, 1 reply; 3+ messages in thread
From: Ulrich Drepper @ 2014-06-24 11:46 UTC (permalink / raw)
  To: Ulrich Drepper, binutils

On Tue, Jun 24, 2014 at 7:40 AM, Alan Modra <amodra@gmail.com> wrote:
> I think it would be better to check for and warn about an empty string
> at "case OPTION_SONAME:", as is done for most other errors.  If you do
> it that way you can actually do as your warning message says,
> ie. ignore the option, without changing comand_line.soname.

I deliberately added the check late since there might be bad wrapper
scripts which generate -soname parameters with empty strings.
Programmers might not be able to change those scripts but might
provide additional -soname parameter to compensate.  Unless the empty
string is actually used a warning looks like unnecessary noise.

But this brings up one point: if a valid -soname use is followed by
one with an empty string it might be useful to not use the latter one
and just emit a warning?  Opinions?

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

* Re: Empty SONAME
  2014-06-24 11:46   ` Ulrich Drepper
@ 2014-06-26 12:26     ` Nicholas Clifton
  0 siblings, 0 replies; 3+ messages in thread
From: Nicholas Clifton @ 2014-06-26 12:26 UTC (permalink / raw)
  To: Ulrich Drepper, binutils

Hi Uli,

> But this brings up one point: if a valid -soname use is followed by
> one with an empty string it might be useful to not use the latter one
> and just emit a warning?  Opinions?

Agreed.  Since an empty soname is not valid we should not accept one 
when it is given.  Either before or after another, valid, -soname parameter.

Cheers
   Nick


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

end of thread, other threads:[~2014-06-26 12:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <8761jrvo5z.fsf@x240.local.i-did-not-set--mail-host-address--so-tickle-me>
2014-06-24 11:40 ` Empty SONAME Alan Modra
2014-06-24 11:46   ` Ulrich Drepper
2014-06-26 12:26     ` 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).