public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Martin Liska <marxin@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/marxin/heads/symver-improve-doc)] docs: update symver attribute description Date: Mon, 12 Apr 2021 12:32:06 +0000 (GMT) [thread overview] Message-ID: <20210412123206.A1F23394FC30@sourceware.org> (raw) https://gcc.gnu.org/g:750b715225d480fcb74e765623d54acc42ac25e3 commit 750b715225d480fcb74e765623d54acc42ac25e3 Author: Martin Liska <mliska@suse.cz> Date: Mon Apr 12 13:42:33 2021 +0200 docs: update symver attribute description gcc/ChangeLog: * doc/extend.texi: Be more precise in documentation of symver attribute. Diff: --- gcc/doc/extend.texi | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index e28e1860990..75e4a43a8c5 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -3848,23 +3848,27 @@ foo_v1 (void) Will produce a @code{.symver foo_v1, foo@@VERS_1} directive in the assembler output. -One can also define multiple version for a given symbol. +One can also define multiple version for a given symbol +(starting from binutils 2.35). @smallexample __attribute__ ((__symver__ ("foo@@VERS_2"), __symver__ ("foo@@VERS_3"))) int symver_foo_v1 (void) @{ @} - -__attribute__ ((__symver__ ("bar@@VERS_2"))) -__attribute__ ((__symver__ ("bar@@VERS_3"))) -int symver_bar_v1 (void) -@{ -@} @end smallexample -This example creates an alias of @code{foo_v1} with symbol name -@code{symver_foo_v1} which will be version @code{VERS_2} of @code{foo}. +This example creates a symbol name @code{symver_foo_v1} +which will be version @code{VERS_2} and @code{VERS_3} of @code{foo}. + +If you have an older release of binutils release, then symbol alias needs to +be used: + +@smallexample +__attribute__ ((__symver__ ("foo@@VERS_2"))) +__attribute__ ((alias ("foo_v1"))) +int symver_foo_v1 (void); +@end smallexample Finally if the parameter is @code{"@var{name2}@@@@@var{nodename}"} then in addition to creating a symbol version (as if
next reply other threads:[~2021-04-12 12:32 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-04-12 12:32 Martin Liska [this message] -- strict thread matches above, loose matches on Subject: below -- 2021-04-12 11:43 Martin Liska
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=20210412123206.A1F23394FC30@sourceware.org \ --to=marxin@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /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: linkBe 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).