public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: poulot@wanadoo.fr
To: gcc-gnats@gcc.gnu.org, debian-gcc@lists.debian.org
Subject: c/7544: gcc does not output weak symbol unless declared
Date: Thu, 08 Aug 2002 15:46:00 -0000	[thread overview]
Message-ID: <E17ctP8-0000vd-00@walhalla.agaha> (raw)


>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:


                 reply	other threads:[~2002-08-08 20:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E17ctP8-0000vd-00@walhalla.agaha \
    --to=poulot@wanadoo.fr \
    --cc=debian-gcc@lists.debian.org \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).