I don't think the difference has to do with the number of versions.
I think it's based on where the versions are set.

An input ELF object file from libc_pic.a may have version
information for a particular symbol.  If it does, I believe it is used
in preference to the version script.  Or it may not, in which case
the version script gets to decide.

ld -u uses symbol names based on the input files' symbol tables, so
versions which are only added by the version script don't count.

In the attachment, try

ld -shared -o version.so unversion.a --version-script version.v -u'bar'

  Gets bar.

ld -shared -o version.so unversion.a --version-script version.v -u'[EMAIL 
PROTECTED]'

  Gets nothing.

ld -shared -o version.so version.a --version-script version.v -u'[EMAIL 
PROTECTED]'

  Gets bar.

The issue is a bit confused because bar and [EMAIL PROTECTED] will both work
with version.a.  I believe that is because version.o provides
bar@@TWO; the two at signs mean it is a default version.  [EMAIL PROTECTED]
will not work with unversion.a, since [EMAIL PROTECTED] will never resolve
at runtime to an unversioned bar.

I don't know how to work out which one to use in advance without
searching through the set of input files trying to find whether bar
is versioned.

-- 
Daniel Jacobowitz
CodeSourcery



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to