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: Markus Trippelsdorf <markus at trippelsdorf dot de>
- To: binutils at sourceware dot org, Nick Clifton <nickc at redhat dot com>, Rafael Avila de Espindola <rafael dot espindola at gmail dot com>
- Date: Tue, 23 Sep 2014 19:21:10 +0200
- 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>
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.
--
Markus