From: Roger Sayle Date: Mon, 12 Jan 2004 18:23:08 +0000 (+0000) Subject: re PR middle-end/11397 (weak aliases broken on Tru64 UNIX) X-Git-Tag: releases/gcc-3.3.3~101 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef2e6ef0ab7a764114ed81eef15b37738294a6c2;p=thirdparty%2Fgcc.git 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. From-SVN: r75740 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d6a2c907d6b9..fb0f28c7a5e0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-01-12 Roger Sayle + + PR middle-end/11397 + * varasm.c (assemble_alias): Remove weak aliases from weak_decls. + 2004-01-12 J"orn Rennecke PR target/13585 diff --git a/gcc/varasm.c b/gcc/varasm.c index 9a760998f620..508118627c4e 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. @@ -4673,14 +4673,26 @@ assemble_alias (decl, target) #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