From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1851) id A1F23394FC30; Mon, 12 Apr 2021 12:32:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A1F23394FC30 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Martin Liska To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/marxin/heads/symver-improve-doc)] docs: update symver attribute description X-Act-Checkin: gcc X-Git-Author: Martin Liska X-Git-Refname: refs/users/marxin/heads/symver-improve-doc X-Git-Oldrev: 598359f627dec765eb74e31d9e96901a68bbfb97 X-Git-Newrev: 750b715225d480fcb74e765623d54acc42ac25e3 Message-Id: <20210412123206.A1F23394FC30@sourceware.org> Date: Mon, 12 Apr 2021 12:32:06 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2021 12:32:06 -0000 https://gcc.gnu.org/g:750b715225d480fcb74e765623d54acc42ac25e3 commit 750b715225d480fcb74e765623d54acc42ac25e3 Author: Martin Liska 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