Commit 52eb57df by Richard Henderson Committed by Richard Henderson

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
parent 8bea7f7c
2005-03-17 Richard Henderson <rth@redhat.com> 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.opt: New file.
* config/alpha/alpha.c (alpha_tune): New. Rename all existing uses * config/alpha/alpha.c (alpha_tune): New. Rename all existing uses
of alpha_cpu. of alpha_cpu.
......
...@@ -1528,7 +1528,8 @@ void f () __attribute__ ((weak, alias ("__f"))); ...@@ -1528,7 +1528,8 @@ void f () __attribute__ ((weak, alias ("__f")));
@end smallexample @end smallexample
declares @samp{f} to be a weak alias for @samp{__f}. In C++, the 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. Not all target machines support this attribute.
...@@ -8579,6 +8580,7 @@ for further explanation. ...@@ -8579,6 +8580,7 @@ for further explanation.
* Solaris Pragmas:: * Solaris Pragmas::
* Symbol-Renaming Pragmas:: * Symbol-Renaming Pragmas::
* Structure-Packing Pragmas:: * Structure-Packing Pragmas::
* Weak Pragmas::
@end menu @end menu
@node ARM Pragmas @node ARM Pragmas
...@@ -8761,7 +8763,7 @@ way of knowing that that happened.) ...@@ -8761,7 +8763,7 @@ way of knowing that that happened.)
@node Structure-Packing Pragmas @node Structure-Packing Pragmas
@subsection 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, directives which change the maximum alignment of members of structures,
unions, and classes subsequently defined. The @var{n} value below always 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 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 ...@@ -8782,6 +8784,28 @@ multiple @code{#pragma pack(@var{n})} instances and finalized by a single
@code{#pragma pack(pop)}. @code{#pragma pack(pop)}.
@end enumerate @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 @node Unnamed Fields
@section Unnamed struct/union fields within structs/unions @section Unnamed struct/union fields within structs/unions
@cindex struct @cindex struct
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment