This is the mail archive of the
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: Tue, 23 Sep 2014 23:31:32 +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>
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.
Bonus points awarded if you arrange the iteration such that a
previously successful claim_file is the first one tried on a new
Australia Development Lab, IBM