This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Empty SONAME
- From: Alan Modra <amodra at gmail dot com>
- To: Ulrich Drepper <drepper at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Tue, 24 Jun 2014 21:10:01 +0930
- Subject: Re: Empty SONAME
- Authentication-results: sourceware.org; auth=none
- References: <8761jrvo5z dot fsf at x240 dot local dot i-did-not-set--mail-host-address--so-tickle-me>
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