aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/doc/extend.texi28
2 files changed, 32 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 65a6616..262674f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
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.
* config/alpha/alpha.c (alpha_tune): New. Rename all existing uses
of alpha_cpu.
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 84349f3..057bdfa 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