[PATCH] dependency list for static libraries

Alan Modra amodra@gmail.com
Mon Nov 9 00:01:46 GMT 2020


On Sun, Nov 08, 2020 at 03:07:28PM +0000, Howard Chu wrote:
> --- a/binutils/ar.c
> +++ b/binutils/ar.c
> @@ -866,7 +866,7 @@ main (int argc, char **argv)
>  	  /* Create a bfd to contain the dependencies.
>  	     It inherits its type from arch, but we must set the type to
>  	     "binary" otherwise bfd_bwrite() will fail.  After writing, we
> -	     must set the type back to "plugin" otherwise adding it to the
> +	     must set the type back to default otherwise adding it to the
>  	     archive will fail.  */
>  	  libdeps_bfd = bfd_create (LIBDEPS, arch);
>  	  if (libdeps_bfd == NULL)
> @@ -887,18 +887,18 @@ main (int argc, char **argv)
>  	  if (! bfd_make_readable (libdeps_bfd))
>  	    fatal (_("Cannot make libdeps object readable."));
>  
> -	  if (bfd_find_target ("plugin", libdeps_bfd) == NULL)
> +	  if (bfd_find_target (plugin_target, libdeps_bfd) == NULL)
>  	    fatal (_("Cannot reset libdeps record type."));

Thanks, I'm going to commit the above changes after running tests.
I'm not going to commit or OK the unrelated change to prepend the
libdeps record.  I think that is a bad idea, because BFD treats the
first object in an archive specially.  In effect, the first object
selects the archive target.  See archive.c:910 and following.

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list