This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Add plugin interface to LD [6/4] Add archive support to plugin interface.
- From: Dave Korn <dave dot korn dot cygwin at gmail dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Thu, 07 Oct 2010 23:14:48 +0100
- Subject: Re: [PATCH] Add plugin interface to LD [6/4] Add archive support to plugin interface.
- References: <4C9AE5CA.80707@gmail.com> <4C9FE8C3.60709@gmail.com> <4CACFEDE.2000101@redhat.com>
On 06/10/2010 23:57, Richard Henderson wrote:
> On 09/26/2010 05:43 PM, Dave Korn wrote:
>> I didn't want to change the interface
>> of add_archive_element, since it's one of the few actual public interfaces of
>> libbfd, and we don't have any versioning.
>
> Nothing in libbfd pretends to have a stable ABI, so I don't think you
> need to worry about that.
> I think I'd prefer a fourth argument for add_archive_element which, if
> non-null, receives the replacement. Thus for a.out we can simply not
> change anything except add the NULL 4th argument. (Recall that a.out
> cannot represent LTO data at all, and so needn't worry about this whole
> plugin business.)
>
> Honestly, I think it would clean up some of your arelt_substitute_bfd
> checks as well.
OK, I was erring on the side of caution, but on most platforms, it won't
even hurt if there's a fourth argument provided by the caller that the callee
doesn't know about; will change it as you suggest.
>> +#ifdef ENABLE_PLUGINS
>> + lang_input_statement_type orig_input;
>> + int fildes;
>> +#endif /* ENABLE_PLUGINS */
>
> See previous comments re keeping decls near code.
>
>> + info_msg ("%I\n",
>> +#ifdef ENABLE_PLUGINS
>> + &orig_input
>> +#else
>> + input
>> +#endif /* ENABLE_PLUGINS */
>
> In this case I don't think you need to conditionalize orig_input.
> Just do it all the time and be done with it.
Right you are. Thanks for the comments.
cheers,
DaveK