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: Alan Modra <amodra at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Wed, 15 Jan 2014 10:25:39 +1030
- 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>
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.
--
Alan Modra
Australia Development Lab, IBM