From 47bd70b56aa4ccc10fd0e90a7fae4c94d991bb30 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 26 Feb 2002 22:17:22 +0100 Subject: attribs.c (c_common_attribute_table): Add visibility. * attribs.c (c_common_attribute_table): Add visibility. (handle_visibility_attribute): New function. * varasm.c (assemble_visibility): New function. * output.h (assemble_visibility): Add prototype. * tree.h (MODULE_LOCAL_P): Define. * crtstuff.c (__dso_handle): Use visibility attribute. * config/i386/i386.h (ENCODE_SECTION_INFO): Set SYMBOL_REF_FLAG for MODULE_LOCAL_P symbols too. * config/ia64/ia64.c (ia64_encode_section_info): Handle MODULE_LOCAL_P symbols the same way as local symbols. Add SDATA_NAME_FLAG_CHAR even if decl was explicitely forced into .sdata/.sbss by the user. * doc/extend.texi (Function Attributes): Document visibility attribute. * gcc.dg/ia64-visibility-1.c: New test. From-SVN: r50061 --- gcc/doc/extend.texi | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'gcc/doc') diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index cc4e25d0feb..f9870e779cf 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -2198,7 +2198,7 @@ The @code{alias} attribute causes the declaration to be emitted as an alias for another symbol, which must be specified. For instance, @smallexample -void __f () @{ /* do something */; @} +void __f () @{ /* @r{Do something.} */; @} void f () __attribute__ ((weak, alias ("__f"))); @end smallexample @@ -2207,6 +2207,19 @@ mangled name for the target must be used. Not all target machines support this attribute. +@item visibility ("@var{visibility_type}") +@cindex @code{visibility} attribute +The @code{visibility} attribute on ELF targets causes the declaration +to be emitted with hidden, protected or internal visibility. + +@smallexample +void __attribute__ ((visibility ("protected"))) +f () @{ /* @r{Do something.} */; @} +int i __attribute__ ((visibility ("hidden"))); +@end smallexample + +Not all ELF targets support this attribute. + @item regparm (@var{number}) @cindex functions that are passed arguments in registers on the 386 On the Intel 386, the @code{regparm} attribute causes the compiler to -- cgit v1.2.1