aboutsummaryrefslogtreecommitdiff
path: root/gcc/defaults.h
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2005-11-09 20:13:41 +0000
committerAlexandre Oliva <aoliva@redhat.com>2005-11-09 20:13:41 +0000
commitb271e90415b0a22fc48f357ef09e99576206e566 (patch)
treecdc3a1f501856957bef831df0b91b2b381edd2b8 /gcc/defaults.h
parent9b06a41755b051eda3715c921f3106cfdec01110 (diff)
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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@106703 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/defaults.h')
-rw-r--r--gcc/defaults.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/defaults.h b/gcc/defaults.h
index 9ac1afc6c11..9d82960e987 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