PATCH: PR ld/16428: autoconf tests don't terminate on ix86-linux-gnu with -static -fPIE -pie on glibc-2.18 based systems
Alan Modra
amodra@gmail.com
Tue Jan 14 23:55:00 GMT 2014
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
More information about the Binutils
mailing list