extend.texi (Weak Pragmas): New section.
authorRichard Henderson <rth@redhat.com>
Thu, 17 Mar 2005 11:55:49 +0000 (03:55 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 17 Mar 2005 11:55:49 +0000 (03:55 -0800)
        * doc/extend.texi (Weak Pragmas): New section.
        (attribute alias): Clarify that target must be in the same
        translation unit.

From-SVN: r96603

gcc/ChangeLog
gcc/doc/extend.texi

index 65a661676784b24401cff8e093c3ed06bac831ca..262674f5c24598f70fe70cecd600f7fa2333fe66 100644 (file)
@@ -1,3 +1,9 @@
+2005-03-17  Richard Henderson  <rth@redhat.com>
+
+       * doc/extend.texi (Weak Pragmas): New section.
+       (attribute alias): Clarify that target must be in the same
+       translation unit.
+
 2005-03-17  Richard Henderson  <rth@redhat.com>
 
        * config/alpha/alpha.opt: New file.
index 84349f3c373a4be35125d3718b7033bd0b665689..057bdfa9fa28f9206428566270e8b5158f8cc414 100644 (file)
@@ -1528,7 +1528,8 @@ void f () __attribute__ ((weak, alias ("__f")));
 @end smallexample
 
 declares @samp{f} to be a weak alias for @samp{__f}.  In C++, the
-mangled name for the target must be used.
+mangled name for the target must be used.  It is an error if @samp{__f}
+is not defined in the same translation unit.
 
 Not all target machines support this attribute.
 
@@ -8579,6 +8580,7 @@ for further explanation.
 * Solaris Pragmas::
 * Symbol-Renaming Pragmas::
 * Structure-Packing Pragmas::
+* Weak Pragmas::
 @end menu
 
 @node ARM Pragmas
@@ -8761,7 +8763,7 @@ way of knowing that that happened.)
 @node Structure-Packing Pragmas
 @subsection Structure-Packing Pragmas
 
-For compatibility with Win32, GCC supports as set of @code{#pragma}
+For compatibility with Win32, GCC supports a set of @code{#pragma}
 directives which change the maximum alignment of members of structures,
 unions, and classes subsequently defined.  The @var{n} value below always
 is required to be a small power of two and specifies the new alignment
@@ -8782,6 +8784,28 @@ multiple @code{#pragma pack(@var{n})} instances and finalized by a single
 @code{#pragma pack(pop)}.
 @end enumerate
 
+@node Weak Pragmas
+@subsection Weak Pragmas
+
+For compatibility with SVR4, GCC supports a set of @code{#pragma}
+directives for declaring symbols to be weak, and defining weak
+aliases.
+
+@table @code
+@item #pragma weak @var{symbol}
+@cindex pragma, weak
+This pragma declares @var{symbol} to be weak, as if the declaration
+had the attribute of the same name.  The pragma may appear before
+or after the declaration of @var{symbol}, but must appear before 
+either its first use or its definition.  It is not an error for
+@var{symbol} to never be defined at all.
+
+@item #pragma weak @var{symbol1} = @var{symbol2}
+This pragma declares @var{symbol1} to be a weak alias of @var{symbol2}.
+It is an error if @var{symbol2} is not defined in the current
+translation unit.
+@end table
+
 @node Unnamed Fields
 @section Unnamed struct/union fields within structs/unions
 @cindex struct