From: Richard Henderson Date: Thu, 17 Mar 2005 11:55:49 +0000 (-0800) Subject: extend.texi (Weak Pragmas): New section. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=52eb57dfb1a459af58f87e8dc71206d7c2ba36a8;p=gcc.git extend.texi (Weak Pragmas): New section. * doc/extend.texi (Weak Pragmas): New section. (attribute alias): Clarify that target must be in the same translation unit. From-SVN: r96603 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 65a66167678..262674f5c24 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-03-17 Richard Henderson + + * doc/extend.texi (Weak Pragmas): New section. + (attribute alias): Clarify that target must be in the same + translation unit. + 2005-03-17 Richard Henderson * config/alpha/alpha.opt: New file. diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 84349f3c373..057bdfa9fa2 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -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