A patch for default version and archive

H . J . Lu hjl@valinux.com
Tue Nov 14 10:28:00 GMT 2000


On Tue, Nov 14, 2000 at 10:03:59AM -0800, Ulrich Drepper wrote:
> "H . J . Lu" <hjl@valinux.com> writes:
> 
> > Your testcase is flawed. See below. Please show me a testcase I can
> > compile.
> 
> I told you it won't compile since I don't care to learn the syntax
> used for the versioned referenced.  Just change the asms in the
> headers and throw out or in the appropriate prototypes.  I've
> explained what it should look like.
> 

I have told you what you described cannot happen since there is no
such an asm syntax to make references to `foo@@ver1'. You can only
make references to `foo@ver1' in assembly code. Why should I worry
about something won't happen? Just in case, here is the asm synax
for .symver again:

-----
`.symver'
=========

   Use the `.symver' directive to bind symbols to specific version nodes
within a source file.  This is only supported on ELF platforms, and is
typically used when assembling files to be linked into a shared library.
There are cases where it may make sense to use this in objects to be
bound into an application itself so as to override a versioned symbol
from a shared library.

   For ELF targets, the `.symver' directive can be used like this:
     .symver NAME, NAME2@NODENAME
   If the symbol NAME is defined within the file being assembled, the
`.symver' directive effectively creates a symbol alias with the name
NAME2@NODENAME, and in fact the main reason that we just don't try and
create a regular alias is that the @ character isn't permitted in
symbol names.  The NAME2 part of the name is the actual name of the
symbol by which it will be externally referenced.  The name NAME itself
is merely a name of convenience that is used so that it is possible to
have definitions for multiple versions of a function within a single
source file, and so that the compiler can unambiguously know which
version of a function is being mentioned.  The NODENAME portion of the
alias should be the name of a node specified in the version script
supplied to the linker when building a shared library.  If you are
attempting to override a versioned symbol from a shared library, then
NODENAME should correspond to the nodename of the symbol you are trying
to override.

   If the symbol NAME is not defined within the file being assembled,
all references to NAME will be changed to NAME2@NODENAME.  If no
reference to NAME is made, NAME2@NODENAME will be removed from the
symbol table.

   Another usage of the `.symver' directive is:
     .symver NAME, NAME2@@NODENAME
   In this case, the symbol NAME must exist and be defined within the
file being assembled. It is similiar to NAME2@NODENAME. The difference
is NAME2@@NODENAME will also be used to resolve references to NAME2 by
the linker.

   The third usage of the `.symver' directive is:
     .symver NAME, NAME2@@@NODENAME
   When NAME is not defined within the file being assembled, it is
treated as NAME2@NODENAME. When NAME is defined within the file being
assembled, the symbol name, NAME, will be changed to NAME2@@NODENAME.
----

Any questions?


-- 
H.J. Lu (hjl@valinux.com)


More information about the Binutils mailing list