public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <ian@wasabisystems.com>
To: "Hespelt, Steve \(Exchange\)" <shespelt@bear.com>
Cc: <gcc-help@gcc.gnu.org>
Subject: Re: symbol level versioning in shared object libraries created by gcc 3.x
Date: Thu, 25 Mar 2004 16:49:00 -0000	[thread overview]
Message-ID: <m3u10dautu.fsf@gossamer.airs.com> (raw)
In-Reply-To: <CDA0C35819D481479A80641791B36703452516@whexchmb06.bsna.bsroot.bear.com>

"Hespelt, Steve \(Exchange\)" <shespelt@bear.com> writes:

> Having read the http://gcc.gnu.org/onlinedocs/libstdc++/abi.txt page, I
> believe the vendor's library has symbol level versioning enabled.
> However, I'm assuming this versioning must be function of the gcc
> compiler as the source of the @GLIBCPP_3.2 being appended to the mangled
> signature of the symbols. How does the compiler know which suffix to
> apply to what symbols? I see free@@GLIBC_2.0 (makes sense to me as
> free() is a C API function) while others have GLIBCPP_3.2 [these are
> symbols of type U according to nm ] while still others have no suffix at
> all [none of the vendor's C++ API member functions have a suffix]. 
> Is there a pragma which, if present in a library's header files, causes
> the suffix to be applied to the generated symbol? If my code uses a
> member function of a stdc++ class, why should the generated reference
> contain the suffix unless the compiler knows to or is the symbol
> declaration modified in the header context to contain the suffix??
> I see in c++config.h the _GLIBCPP_SYMVER not define'd in our copy [the
> #undef _GLIBCPP_SYMVER is commented out] but the above questions still
> remain - how does gcc know which symbols to append the @GLIBCPP_ to when
> compiling my source code to object code which at run-time depends on the
> symbols matching those found in libraries such as libstdc++ ?

The compiler does not have anything to do with symbol versioning.  In
general, symbol versions are added when the shared library is created,
by passing a version script to the linker.

I don't think you mentioned what OS you are using, but in glibc for
GNU/Linux, the version script is probably here:
    sysdeps/unix/sysv/linux/Versions

Some symbols may also get version strings from assembler code which
appears in glibc headers files.  Look at include/libc-symbols.h.

Ian

  reply	other threads:[~2004-03-25 14:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-25 15:32 Hespelt, Steve (Exchange)
2004-03-25 16:49 ` Ian Lance Taylor [this message]
2004-03-25 19:07 Hespelt, Steve (Exchange)
2004-03-25 19:45 ` llewelly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3u10dautu.fsf@gossamer.airs.com \
    --to=ian@wasabisystems.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=shespelt@bear.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).