This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Add plugin interface to LD [3/4] Get symbols and resolutions.
- 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:18:05 +0100
- Subject: Re: [PATCH] Add plugin interface to LD [3/4] Get symbols and resolutions.
- References: <4C9AE5CA.80707@gmail.com> <4C9AE64E.3040002@gmail.com> <4CACF820.3060705@redhat.com>
On 06/10/2010 23:28, Richard Henderson wrote:
> On 09/22/2010 10:31 PM, Dave Korn wrote:
>> + if (blhe->type == bfd_link_hash_common)
>> + {
>> + /* Is this right? The COMMON section only exists in the
>> + output file, so it seems reasonable. */
>> + syms[n].resolution = LDPR_RESOLVED_EXEC;
>> + continue;
>
> Common symbols can be exported or not exported when generating a
> shared library. Another check is needed here. In fact, I don't
> see that you're doing any shared library preemption checking in
> this function.
>
> ... that said, all that is elf-only; windows doesn't do library
> symbol preemption.
Yep. Or visibility for that matter. And library symbols typically get
resolved in practice by linking an import stub into the executable.
>
>> + /* Suppresses "unused" warnings without relying on GCC attribute. */
>> + info = info;
>> + value = value;
>
> Er, I presume this is going away in a future patch?
Well I had to do something to suppress the unused warnings, those parameters
are passed by the BFD callback interface whether I need to use them or not.
We've got ATTRIBUTE_UNUSED, I know, but I thought "Why not use something
completely generic". I see you've asked for ATTRIBUTE_UNUSED in one of the
other posts, so I'll do that.
Need to think more about the common symbols, but have to go AFK for a while
now. Thanks for all the help, I'll get back on this later.
cheers,
DaveK