This is the mail archive of the binutils@sourceware.org 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]

Re: Empty SONAME


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


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