aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2020-08-24 13:21:10 +0200
committerMartin Liska <mliska@suse.cz>2020-08-26 10:03:19 +0200
commit363080bb8bd2cca81dd9e2e774910a8c8226f430 (patch)
treedbd812c1ccd60680bc8aaaa61140d251e64efc4b /gcc/doc
parentd58e7173ef964ddac3ab3ad8cc97de8f9f3b32ee (diff)
downloadgcc-363080bb8bd2cca81dd9e2e774910a8c8226f430.zip
gcc-363080bb8bd2cca81dd9e2e774910a8c8226f430.tar.gz
gcc-363080bb8bd2cca81dd9e2e774910a8c8226f430.tar.bz2
IPA symver: allow multiple symvers for a definition
gcc/ChangeLog: * cgraphunit.c (process_symver_attribute): Allow multiple symver attributes for one symbol. * doc/extend.texi: Document the change. gcc/testsuite/ChangeLog: * lib/target-supports-dg.exp: Add dg-require-symver. * lib/target-supports.exp: Likewise. * gcc.dg/ipa/symver1.c: New test.
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/extend.texi16
1 files changed, 11 insertions, 5 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 2bb9b2f..3b37aba 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -3742,13 +3742,19 @@ foo_v1 (void)
Will produce a @code{.symver foo_v1, foo@@VERS_1} directive in the assembler
output.
-It's an error to define multiple version of a given symbol. In such case
-an alias can be used.
+One can also define multiple version for a given symbol.
@smallexample
-__attribute__ ((__symver__ ("foo@@VERS_2")))
-__attribute__ ((alias ("foo_v1")))
-int symver_foo_v1 (void);
+__attribute__ ((__symver__ ("foo@@VERS_2"), ("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