This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: ELIMINATE_COPY_RELOCS problems on ppc
On Wed, Apr 02, 2003 at 07:08:15PM -0800, H. J. Lu wrote:
> On Thu, Apr 03, 2003 at 11:23:13AM +0930, Alan Modra wrote:
> > On Thu, Apr 03, 2003 at 09:45:24AM +0930, Alan Modra wrote:
> > > Also, I'd like to hear from Geoff as to why we
> > > have both SYMBOL_REFERENCES_LOCAL and SYMBOL_CALLS_LOCAL, introduced
> > > by http://sources.redhat.com/ml/binutils/2000-10/msg00184.html. They
> > > differ in that SYMBOL_REFERENCES_LOCAL doesn't consider STV_PROTECTED
> > > syms as local, which seems a bit strange to me.
> >
> > Oh, nevermind. I'm a dunce. Funny how seeing a testcase fail,
> > glibc's elf/vismain.c in this case, makes things obvious. :)
> >
>
> The current ld doesn't support visibility very well. In my last
> visibility change, I added some more visibility testcases.
Yes, it's a little tricky, which is why I haven't yet been game to
OK your patch even though it looks good to me.
I think I should add this comment to explain SYMBOL_REFERENCES_LOCAL.
* elf32-ppc.c (SYMBOL_REFERENCES_LOCAL): Expand comment.
Index: bfd/elf32-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-ppc.c,v
retrieving revision 1.73
diff -u -p -r1.73 elf32-ppc.c
--- bfd/elf32-ppc.c 3 Apr 2003 02:54:52 -0000 1.73
+++ bfd/elf32-ppc.c 3 Apr 2003 03:47:14 -0000
@@ -147,8 +147,12 @@ static bfd_boolean ppc_elf_grok_psinfo
#define DTP_OFFSET 0x8000
/* Will references to this symbol always reference the symbol
- in this object? */
-#define SYMBOL_REFERENCES_LOCAL(INFO, H) \
+ in this object? STV_PROTECTED is excluded from the visibility test
+ here so that function pointer comparisons work properly. Since
+ function symbols not defined in an app are set to their .plt entry,
+ it's necessary for shared libs to also reference the .plt even
+ though the symbol is really local to the shared lib. */
+#define SYMBOL_REFERENCES_LOCAL(INFO, H) \
((! INFO->shared \
|| INFO->symbolic \
|| H->dynindx == -1 \
--
Alan Modra
IBM OzLabs - Linux Technology Centre