diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2005-11-09 20:13:41 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@gcc.gnu.org> | 2005-11-09 20:13:41 +0000 |
commit | a0203ca711308b96d33acb895d4f7d254594287c (patch) | |
tree | cdc3a1f501856957bef831df0b91b2b381edd2b8 /gcc/defaults.h | |
parent | 317adebb1faac58d50f0e44906aa18edaf663759 (diff) | |
download | gcc-a0203ca711308b96d33acb895d4f7d254594287c.zip gcc-a0203ca711308b96d33acb895d4f7d254594287c.tar.gz gcc-a0203ca711308b96d33acb895d4f7d254594287c.tar.bz2 |
re PR other/4372 (#pragma weak pthread* inclusion causes applications to crash without a linker error when one forgets to link with -lpthread)
PR other/4372
* tree.h (IDENTIFIER_TRANSPARENT_ALIAS): New.
(TREE_DEPRECATED): Adjust comment. Check for a DECL.
* c-common.c (handle_weakref_attribute): New.
(c_common_attribute_table): Add weakref.
* configure.ac (HAVE_GAS_WEAKREF): Check for weakref support
in the assembler.
* configure, config.in: Rebuilt.
* defaults.h (ASM_OUTPUT_WEAKREF): Define if HAVE_GAS_WEAKREF.
* doc/extend.texi: Document weakref attribute.
* varasm.c (ultimate_transparent_alias_target): New
(assemble_name): Use it.
(weak_finish_1): Split out of...
(weak_finish): ... and deal with weakrefs in...
(weakref_targets): ... new list.
(globalize_decl): Clean up weakref_targets.
(do_assemble_alias): Handle weakrefs.
(finish_aliases_1): Do not reject weakrefs to external symbols.
(assemble_alias): Handle weakrefs.
From-SVN: r106703
Diffstat (limited to 'gcc/defaults.h')
-rw-r--r-- | gcc/defaults.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/defaults.h b/gcc/defaults.h index 9ac1afc..9d82960 100644 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -166,6 +166,27 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA #endif #endif +/* This is how we tell the assembler that a symbol is a weak alias to + another symbol that doesn't require the other symbol to be defined. + Uses of the former will turn into weak uses of the latter, i.e., + uses that, in case the latter is undefined, will not cause errors, + and will add it to the symbol table as weak undefined. However, if + the latter is referenced directly, a strong reference prevails. */ +#ifndef ASM_OUTPUT_WEAKREF +#if defined HAVE_GAS_WEAKREF +#define ASM_OUTPUT_WEAKREF(FILE, NAME, VALUE) \ + do \ + { \ + fprintf ((FILE), "\t.weakref\t"); \ + assemble_name ((FILE), (NAME)); \ + fprintf ((FILE), ","); \ + assemble_name ((FILE), (VALUE)); \ + fprintf ((FILE), "\n"); \ + } \ + while (0) +#endif +#endif + /* How to emit a .type directive. */ #ifndef ASM_OUTPUT_TYPE_DIRECTIVE #if defined TYPE_ASM_OP && defined TYPE_OPERAND_FMT |