aboutsummaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2004-01-12 17:22:12 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2004-01-12 17:22:12 +0000
commit06e4eab5549af09b0f39712db7def539de7f88e2 (patch)
treea5b53ee764cf49caa9c03af6812789bb7352ebad /gcc/varasm.c
parentdc6798f86565a8d31de69989cc27568ac7acb1e7 (diff)
downloadgcc-06e4eab5549af09b0f39712db7def539de7f88e2.zip
gcc-06e4eab5549af09b0f39712db7def539de7f88e2.tar.gz
gcc-06e4eab5549af09b0f39712db7def539de7f88e2.tar.bz2
re PR middle-end/11397 (weak aliases broken on Tru64 UNIX)
PR middle-end/11397 * varasm.c (assemble_alias): Remove weak aliases from weak_decls. * gcc.dg/special/wkali-2.c: Add dg-require-alias. From-SVN: r75737
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 3f5905a..17d2d34 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1,6 +1,6 @@
/* Output variables, constants and external declarations, for GNU compiler.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
- 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GCC.
@@ -4411,14 +4411,26 @@ assemble_alias (tree decl, tree target ATTRIBUTE_UNUSED)
#endif
#else /* !ASM_OUTPUT_DEF */
#if defined (ASM_OUTPUT_WEAK_ALIAS) || defined (ASM_WEAKEN_DECL)
- if (! DECL_WEAK (decl))
- warning ("only weak aliases are supported in this configuration");
-
+ if (DECL_WEAK (decl))
+ {
+ tree *p, t;
#ifdef ASM_WEAKEN_DECL
- ASM_WEAKEN_DECL (asm_out_file, decl, name, IDENTIFIER_POINTER (target));
+ ASM_WEAKEN_DECL (asm_out_file, decl, name, IDENTIFIER_POINTER (target));
#else
- ASM_OUTPUT_WEAK_ALIAS (asm_out_file, name, IDENTIFIER_POINTER (target));
+ ASM_OUTPUT_WEAK_ALIAS (asm_out_file, name, IDENTIFIER_POINTER (target));
#endif
+ /* Remove this function from the pending weak list so that
+ we do not emit multiple .weak directives for it. */
+ for (p = &weak_decls; (t = *p) ; )
+ if (DECL_ASSEMBLER_NAME (decl)
+ == DECL_ASSEMBLER_NAME (TREE_VALUE (t)))
+ *p = TREE_CHAIN (t);
+ else
+ p = &TREE_CHAIN (t);
+ }
+ else
+ warning ("only weak aliases are supported in this configuration");
+
#else
warning ("alias definitions not supported in this configuration; ignored");
#endif