Bug#62008: ld leaves hidden/internal symbols in the symbol table (Patch Included)

Ian Lance Taylor ian@zembu.com
Mon Apr 10 11:44:00 GMT 2000


   Date: Mon, 10 Apr 2000 00:17:42 +0200
   From: Martin von Loewis <loewis@informatik.hu-berlin.de>

   > I don't understand this.  In what way are STV_HIDDEN symbols different
   > from symbols made local by versioning that makes them need to be
   > handled differently?

   That's a good point. Where exactly is that feature implemented in
   binutils? It seems that it is not generally available in a
   platform-independent manner, is it? For example, on PPC, I see a
   comment

		 /* FIXME: We should here do what the m68k and i386
		    backends do: if the reloc is pc-relative, record it
		    in case it turns out that the reloc is unnecessary
		    because the symbol is forced local by versioning or
		    we are linking with -Bdynamic.  Fortunately this
		    case is not frequent.  */

   Does that mean that the name-hiding by versioning does not work for
   PPC, or that it is achieved by different means? If so, how?

I believe this comment is referring to a specific case.  If you have a
PC relative reloc in a shared library, and the symbol does not need to
be globally visible, then there is no need to emit a dynamic
relocation at all.  The fully resolved PC relative relocation is
certain to be correct.

I believe there is a typo in the comment: it should say ``-Bsymbolic''
rather than ``-Bdynamic.''

I don't think this means that symbol hiding doesn't work for the
PowerPC.  It only means that the linker emits an unnecessary dynamic
reloc in some cases.


It is true that local symbols are not implemented in a platform
independent manner.  They are implemented in the various
relocate_section functions of the processor backends.

Ian


More information about the Binutils mailing list