This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PowerpC pointer_equality_needed optimisation
On Fri, Feb 22, 2008 at 10:03:46PM -0500, Daniel Jacobowitz wrote:
> On Sat, Feb 23, 2008 at 12:22:29PM +1030, Alan Modra wrote:
> > + else if (!h->ref_regular_nonweak)
> > + {
> > + /* Choose your poison. We must have either text
> > + dynamic relocations, broken function pointer
> > + comparisons, or broken tests for a NULL
> > + function pointer. */
> > + (*_bfd_error_handler)
> > + (_("weak reference to %s in non-pic code"
> > + " will break function pointer comparisons"),
> > + h->root.root.string);
> > + sym->st_value = 0;
> > + }
>
> Isn't this warning going to trigger in, e.g., the gcc gthread_*
> functions and thus in lots of applications?
I haven't seen it. Admittedly, all I've built so far is binutils, gcc
and glibc.. I suppose I may need to remove the warning.
Oh, and I see removing non_got_ref caused regressions so I'm reverting
that change for the time being. I still think that setting
non_got_ref on branch relocs is wrong, but if I remove it then we also
should not consider these relocations as possibly generating dynamic
relocs. Making that change will require some testing.
* elf32-ppc.c (ppc_elf_check_relocs): Revert non_got_ref change.
Index: bfd/elf32-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-ppc.c,v
retrieving revision 1.230
diff -u -p -r1.230 elf32-ppc.c
--- bfd/elf32-ppc.c 23 Feb 2008 01:56:21 -0000 1.230
+++ bfd/elf32-ppc.c 23 Feb 2008 05:37:16 -0000
@@ -3464,6 +3464,9 @@ ppc_elf_check_relocs (bfd *abfd,
a function defined in a dynamic object. */
if (!update_plt_info (abfd, h, NULL, 0))
return FALSE;
+
+ /* We may need a copy reloc too. */
+ h->non_got_ref = 1;
}
dodyn:
--
Alan Modra
Australia Development Lab, IBM