From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29480 invoked by alias); 8 Aug 2002 20:06:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 29460 invoked by uid 71); 8 Aug 2002 20:06:01 -0000 Resent-Date: 8 Aug 2002 20:06:01 -0000 Resent-Message-ID: <20020808200601.29459.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, poulot@wanadoo.fr Received: (qmail 27541 invoked from network); 8 Aug 2002 19:57:16 -0000 Received: from unknown (HELO walhalla.agaha) (80.8.9.206) by sources.redhat.com with SMTP; 8 Aug 2002 19:57:16 -0000 Received: from agaha by walhalla.agaha with local (Exim 3.35 #1 (Debian)) id 17ctP8-0000vd-00; Thu, 08 Aug 2002 21:57:06 +0200 Message-Id: Date: Thu, 08 Aug 2002 15:46:00 -0000 From: poulot@wanadoo.fr Reply-To: poulot@wanadoo.fr To: gcc-gnats@gcc.gnu.org, debian-gcc@lists.debian.org X-Send-Pr-Version: 3.113 Subject: c/7544: gcc does not output weak symbol unless declared X-SW-Source: 2002-08/txt/msg00176.txt.bz2 List-Id: >Number: 7544 >Category: c >Synopsis: #pragma weak problem >Confidential: no >Severity: serious >Priority: low >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Thu Aug 08 13:06:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Benoit Poulot-Cazajous >Release: 3.1.1 (Debian testing/unstable) >Organization: >Environment: System: Linux walhalla 2.4.19 #2 Sat Aug 3 11:56:01 CEST 2002 i686 unknown unknown GNU/Linux Architecture: i686 host: i386-pc-linux-gnu build: i386-pc-linux-gnu target: i386-pc-linux-gnu configured with: /mnt/data/gcc-3.1/gcc-3.1-3.1.1ds3/src/configure -v --enable-languages=c,c++,java,f77,proto,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/-3.1 --enable-shared --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --enable-clocale=gnu --enable-__cxa_atexit --enable-threads=posix --enable-java-gc=boehm --enable-objc-gc i386-linux >Description: When using '#pragma weak bar = foo', gcc does not output anything, unless bar is declared. gcc-2.95 and other compilers do not require such a declaration. >How-To-Repeat: $ cat bug.c #pragma weak bar = foo $ gcc-3.1 bug.c -S -o - .file "bug.c" .ident "GCC: (GNU) 3.1.1" $ gcc-2.95 bug.c -S -o - .file "bug.c" .version "01.01" gcc2_compiled.: .weak bar .set bar,foo .ident "GCC: (GNU) 2.95.4 20011002 (Debian prerelease)" In order to get the correct output, bar() has to be declared : $ cat bug2.c #pragma weak bar = foo void bar(); $ gcc-3.1 bug2.c -S -o - .file "bug2.c" .weak bar <=== Ok !!! .set bar,foo <===/ .ident "GCC: (GNU) 3.1.1" >Fix: >Release-Note: >Audit-Trail: >Unformatted: