This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] bfd: Add support for more than one plugin in lib/bfd-plugins
- From: Alan Modra <amodra at gmail dot com>
- To: Markus Trippelsdorf <markus at trippelsdorf dot de>
- Cc: binutils at sourceware dot org, Nick Clifton <nickc at redhat dot com>, Rafael Avila de Espindola <rafael dot espindola at gmail dot com>
- Date: Wed, 24 Sep 2014 11:19:16 +0930
- Subject: Re: [PATCH] bfd: Add support for more than one plugin in lib/bfd-plugins
- Authentication-results: sourceware.org; auth=none
- References: <20140923062536 dot GA28768 at x4> <20140923120806 dot GA3836 at bubble dot grove dot modra dot org> <20140923130729 dot GB28768 at x4> <20140923140132 dot GB3836 at bubble dot grove dot modra dot org> <20140923172110 dot GA9857 at x4>
On Tue, Sep 23, 2014 at 07:21:10PM +0200, Markus Trippelsdorf wrote:
> On 2014.09.23 at 23:31 +0930, Alan Modra wrote:
> > On Tue, Sep 23, 2014 at 03:07:29PM +0200, Markus Trippelsdorf wrote:
> > > On 2014.09.23 at 21:38 +0930, Alan Modra wrote:
> > > > A perhaps more serious issue is that after your patch we'll call
> > > > dlopen() and onload() on each lto input object file. Before, we
> > > > dlopen a plugin and call onload just once.
> > >
> > > That is the price to pay for handling mixed (LLVM/GCC/native) archives.
> >
> > No, you can still get by with one dlopen per plugin without
> > complicating matters too much. The idea is to load all the plugins
> > the first time you need any, storing their claim_file function
> > addresses in a dynamically allocated array or linked list. Then for
> > each object file, iterate over these claim_file functions until you
> > find one that claims the object.
>
> All this is already handled by Linux in the background. Just look at
> strace output. So I think implementing the above is not necessary.
Well, OK, since the bfd/plugin.c code is really only for ar, nm and
suchlike the extra time spent in glibc and the lto-plugin probably
doesn't matter. The patch is OK. I'll be coming back to you if
this needs fixing in the future!
--
Alan Modra
Australia Development Lab, IBM