This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

(doc) x86-win32 "shared" attribute


Forgot to add the doc update.

Sat Aug  7 11:40:47 1999  Mumit Khan  <khan@xraylith.wisc.edu>

	* extend.texi: Document `shared' variable attribute.

Index: extend.texi
===================================================================
RCS file: /homes/khan/src/CVSROOT/gcc-2.95/gcc/extend.texi,v
retrieving revision 1.1.1.1
diff -u -3 -p -r1.1.1.1 extend.texi
--- extend.texi	1999/06/14 21:05:18	1.1.1.1
+++ extend.texi	1999/08/07 16:39:28
@@ -1998,6 +1998,32 @@ attribute is not available on all platfo
 If you need to map the entire contents of a module to a particular
 section, consider using the facilities of the linker instead.
 
+@item shared
+@cindex @code{shared} variable attribute
+On Windows NT, in addition to nputting variable definitions in a named 
+section, the section can also be shared among all running copies of an 
+executable or DLL. For example, this small program defines shared data 
+by putting it in a named section "shared" and marking the section 
+shareable:
+
+@smallexample
+int foo __attribute__((section ("shared"), shared)) = 0;
+
+int
+main()
+@{
+  /* Read and write foo. All running copies see the same value. */
+  return 0;
+@}
+@end smallexample
+
+@noindent
+You may only use the @code{shared} attribute along with @code{section}
+attribute with a fully initialized global definition because of the way 
+linkers work.  See @code{section} attribute for more information.
+
+The @code{shared} attribute is only available on Windows NT.
+
 @item transparent_union
 This attribute, attached to a function parameter which is a union, means
 that the corresponding argument may have the type of any union member,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]