This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


> Date: Mon, 10 Apr 2000 00:17:42 +0200
> From: Martin von Loewis <loewis@informatik.hu-berlin.de>
> CC: hjl@lucon.org, drepper@redhat.com, chip@valinux.com,
>         binutils@sourceware.cygnus.com, nickc@cygnus.com
> User-Agent: SEMI/1.13.7 (Awazu) FLIM/1.13.2 (Kasanui) Emacs/20.6 (sparc-sun-solaris2.6) MULE/4.0 (HANANOEN)
> 
> > 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?

This comment just describes an optimisation that ppc doesn't do
(actually, I'm not sure the comment is correct, but it doesn't
matter).

The actual functionality is done in generic code, by converting a
reloc relative to a global symbol into a reloc relative to a section
symbol.  Section symbols are the only local symbols allowed in the
dynamic symbol table, because they are the only local symbols that
anyone should need; any other symbol is equivalent to a section symbol
plus some offset.

It might help you to try some examples of symbols forced local by
versioning on your favourite ELF platform.  For instance, see what
relocations

	.globl foo
	.section "data"
foo:	.long foo

produces when 'foo' is made local by a version script, compared to
what are produced when it isn't.

-- 
- Geoffrey Keating <geoffk@cygnus.com>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]