diff options
author | Geoffrey Keating <geoffk@apple.com> | 2005-12-05 20:38:37 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@gcc.gnu.org> | 2005-12-05 20:38:37 +0000 |
commit | a9b0b82578a7f552e3530e690a147303a592a34e (patch) | |
tree | 5e7f04633347fa5f7ca0e1b9e1b991f1227bdea4 /gcc/doc | |
parent | 68e58c33468f3523c1eb6232d0a4d1e949db3011 (diff) | |
download | gcc-a9b0b82578a7f552e3530e690a147303a592a34e.zip gcc-a9b0b82578a7f552e3530e690a147303a592a34e.tar.gz gcc-a9b0b82578a7f552e3530e690a147303a592a34e.tar.bz2 |
Index: gcc/ChangeLog
2005-12-05 Geoffrey Keating <geoffk@apple.com>
* varasm.c (default_binds_local_p_1): Weakrefs don't bind locally.
A hidden weak object does bind locally. Strong linkonce data
counts like any other strong symbol for binding.
(weak_finish_1): Don't specially handle weakrefs, they no longer
arrive here.
(assemble_alias): Weakrefs can't be TREE_PUBLIC yet.
* c-common.c (handle_alias_attribute): Allow static aliases
of variables.
(handle_weakref_attribute): Don't call declare_weak on weakrefs.
* gthr-dce.h: Make weakrefs static.
* gthr-tpf.h: Likewise.
* gthr-solaris.h: Likewise.
* gthr-posix.h: Likewise.
* gthr-posix95.h: Likewise.
* config/darwin.c (darwin_encode_section_info): static weakref
variables are not necessarily defined in this translation unit.
* doc/extend.texi (Function Attributes): Mention that an alias
attribute creates a definition for the thing it's attached to.
Change the documentation for weakref to say that the thing
it's attached to must be static.
Index: gcc/testsuite/ChangeLog
2005-12-05 Geoffrey Keating <geoffk@apple.com>
* g++.old-deja/g++.abi/vtable2.C: Make weakrefs static.
* gcc.dg/attr-weakref-1.c: Modify to not try to test public weakrefs,
and to work on Darwin.
* gcc.dg/attr-weakref-1b.c: New file.
* gcc.dg/attr-weakref-2.c: New test.
* gcc.dg/darwin-weakref-1.c: New test.
From-SVN: r108074
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/extend.texi | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index a796da6..341d624 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -1554,7 +1554,7 @@ void __f () @{ /* @r{Do something.} */; @} void f () __attribute__ ((weak, alias ("__f"))); @end smallexample -declares @samp{f} to be a weak alias for @samp{__f}. In C++, the +defines @samp{f} to be a weak alias for @samp{__f}. In C++, the mangled name for the target must be used. It is an error if @samp{__f} is not defined in the same translation unit. @@ -2376,12 +2376,12 @@ implicitly marks the declaration as @code{weak}. Without a @code{weakref} is equivalent to @code{weak}. @smallexample -extern int x() __attribute__ ((weakref ("y"))); +static int x() __attribute__ ((weakref ("y"))); /* is equivalent to... */ -extern int x() __attribute__ ((weak, weakref, alias ("y"))); +static int x() __attribute__ ((weak, weakref, alias ("y"))); /* and to... */ -extern int x() __attribute__ ((weakref)); -extern int x() __attribute__ ((alias ("y"))); +static int x() __attribute__ ((weakref)); +static int x() __attribute__ ((alias ("y"))); @end smallexample A weak reference is an alias that does not by itself require a @@ -2396,6 +2396,9 @@ separate translation unit, renaming the alias to the aliased symbol, declaring it as weak, compiling the two separate translation units and performing a reloadable link on them. +At present, a declaration to which @code{weakref} is attached can +only be @code{static}. + @item externally_visible @cindex @code{externally_visible} attribute. This attribute, attached to a global variable or function nullify |