This is the mail archive of the binutils@sourceware.org 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]
Other format: [Raw text]

Re: Question on symbol versioning


"Amker.Cheng" <amker.cheng@gmail.com> writes:

>    I am studying elf symbol versioning referring document from following address
> http://lists.debian.org/lsb-spec/1999/12/msg00017.html
>    However, at "Symbol lookup" section, for the second case, there are words
> like:
> ----------------------------------------------------
> In case only the object file with the reference does not use
> versioning but the object with the definition does, then the reference
> only matches the base definition.  The base definition is the one with
> index numbers 1 and 2 (1 is the unspecified name, 2 is the name given
> later to the baseline of symbols once the library started using symbol
> versioning).
> ----------------------------------------------------
> I am puzzled about
>
> 1 : "The base definition is the one with index numbers 1 and 2"
> Question :
> What does the index number mean, vd_ndx in Elfxx_Verdef?
> How could a base definition has two index numbers?or both definitions
> with index number 1 or 2 are base definition?
>
> 2 : "1 is the unspecified name"
> Question :
> What does the unspecified name mean?

I have no idea what the above paragraph means.

Object files don't have version definitions.  Version definitions only
appear in executables and shared libraries.  In an object file, version
names are appended to symbol names, separated by one or two '@'
characters.  If there are two '@' characters, the version is the default
version.  If there is only one, it is not.

If an object file defines a symbol S with a version, and a different
object refers to the symbol S with no version, then the reference
matches the definition if the definition is a default version--i.e., if
it has two '@' characters.  Another way to phrase that is that a symbol
definition with two '@' characters defines two symbols at link time: one
symbol with no version, and one symbol with the specified version.

Ian


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