This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: PR ld/16428: autoconf tests don't terminate on ix86-linux-gnu with -static -fPIE -pie on glibc-2.18 based systems
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Binutils <binutils at sourceware dot org>
- Date: Tue, 14 Jan 2014 16:14:08 -0800
- Subject: Re: PATCH: PR ld/16428: autoconf tests don't terminate on ix86-linux-gnu with -static -fPIE -pie on glibc-2.18 based systems
- Authentication-results: sourceware.org; auth=none
- References: <20140114190659 dot GA1027 at intel dot com> <20140114235539 dot GU5390 at bubble dot grove dot modra dot org>
On Tue, Jan 14, 2014 at 3:55 PM, Alan Modra <amodra@gmail.com> wrote:
> On Tue, Jan 14, 2014 at 11:06:59AM -0800, H.J. Lu wrote:
>> for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
>> {
>> - p->count -= p->pc_count;
>> - p->pc_count = 0;
>> + /* Don't update reloc count if there are any non
>> + pc-relative relocs. */
>> + if (!h->pointer_equality_needed)
>
> This loop invariant ought to be taken outside the loop.
>
>> + {
>> + p->count -= p->pc_count;
>> + p->pc_count = 0;
>> + }
>> if (p->count == 0)
>> *pp = p->next;
>> else
>
> Note also the comment:
>
> /* Relocs that use pc_count are those that appear on a call
> insn, or certain REL relocs that can generated via assembly.
> We want calls to protected symbols to resolve directly to the
> function rather than going via the plt. If people want
> function pointer comparisons to work as expected then they
> should avoid writing weird assembly. */
> if (SYMBOL_CALLS_LOCAL (info, h))
>
> With your patch you've effectively chosen to break protected symbols
> to make function pointer comparisons work.. I'm not sure that is a
> good idea, but if that's the way you want to go, please correct the
> comment too.
>
I will take another look.
--
H.J.