public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/6343: attribute((weak)) not working on second declaration
@ 2002-04-17 18:06 harinath
  0 siblings, 0 replies; 6+ messages in thread
From: harinath @ 2002-04-17 18:06 UTC (permalink / raw)
  To: gcc-gnats


>Number:         6343
>Category:       c
>Synopsis:       attribute((weak)) not working on second declaration
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 17 18:06:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     harinath@cs.umn.edu
>Release:        gcc version 3.2 20020416 (experimental)
>Organization:
>Environment:
i686-pc-linux-gnu
>Description:
gcc/crtstuff.c depends on being able to do

  int foo(void);
  int foo(void) attribute((weak));

and have the symbol 'foo' being marked weak.

This doesn't seem to be working.

Here are two compiles of the attached file, and the output of nm.

$ gcc -shared -o foo.so foo.c
$ nm --dynamic foo.so
00001838 A _DYNAMIC
00001914 A _GLOBAL_OFFSET_TABLE_
         w _Jv_RegisterClasses
00001944 A __bss_start
         w __cxa_finalize
         U __deregister_frame_info_bases
         w __gmon_start__
         U __register_frame_info_bases
00001944 A _edata
00001960 A _end
00000810 T _fini
000005cc T _init
00000790 T bar
         w foo
$ gcc -DNONWEAK -shared -o foo.so foo.c
$ nm --dynamic foo.so
00001838 A _DYNAMIC
00001914 A _GLOBAL_OFFSET_TABLE_
         w _Jv_RegisterClasses
00001944 A __bss_start
         w __cxa_finalize
         U __deregister_frame_info_bases
         w __gmon_start__
         U __register_frame_info_bases
00001944 A _edata
00001960 A _end
00000810 T _fini
000005cc T _init
00000790 T bar
         U foo

Notice 'foo' is not marked weak in the second case.  This is exactly the way this attribute is used in gcc/crtstuff.c (which is also reflected above, see the non-weak references to __register_frame_info_bases, and the weak reference to __cxa_finalize).
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-csrc; name="foo.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="foo.c"

I2lmIGRlZmluZWQgTk9OV0VBSwppbnQgZm9vKHZvaWQpOwojZW5kaWYKaW50IGZvbyh2b2lkKSBf
X2F0dHJpYnV0ZV9fKChfX3dlYWtfXykpOwoKaW50IGJhcih2b2lkKQp7CiAgaWYgKGZvbykgcmV0
dXJuIGZvbygpOwogIHJldHVybiAtMTsKfQoK


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: c/6343: attribute((weak)) not working on second declaration
@ 2002-05-01 11:05 sirl
  0 siblings, 0 replies; 6+ messages in thread
From: sirl @ 2002-05-01 11:05 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, harinath, sirl

Synopsis: attribute((weak)) not working on second declaration

State-Changed-From-To: analyzed->closed
State-Changed-By: sirl
State-Changed-When: Wed May  1 11:05:49 2002
State-Changed-Why:
    Fixed.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6343


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: c/6343: attribute((weak)) not working on second declaration
@ 2002-04-23 13:36 jason
  0 siblings, 0 replies; 6+ messages in thread
From: jason @ 2002-04-23 13:36 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, harinath, jason, sirl

Synopsis: attribute((weak)) not working on second declaration

Responsible-Changed-From-To: jason->sirl
Responsible-Changed-By: jason
Responsible-Changed-When: Tue Apr 23 13:36:33 2002
Responsible-Changed-Why:
    Franz is working on this.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6343


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: c/6343: attribute((weak)) not working on second declaration
@ 2002-04-23  7:36 Raja R Harinath
  0 siblings, 0 replies; 6+ messages in thread
From: Raja R Harinath @ 2002-04-23  7:36 UTC (permalink / raw)
  To: jason; +Cc: gcc-prs

The following reply was made to PR c/6343; it has been noted by GNATS.

From: Raja R Harinath <harinath@cs.umn.edu>
To: jason@gcc.gnu.org
Cc: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org,
   gcc-gnats@gcc.gnu.org, jason@gcc.gnu.org
Subject: Re: c/6343: attribute((weak)) not working on second declaration
Date: Tue, 23 Apr 2002 09:26:17 -0500

 Hi,
 
 jason@gcc.gnu.org writes:
 
 > Synopsis: attribute((weak)) not working on second declaration
 >
 > Responsible-Changed-From-To: unassigned->jason
 > Responsible-Changed-By: jason
 > Responsible-Changed-When: Tue Apr 23 06:14:23 2002
 > Responsible-Changed-Why:
 >     got it
 >
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6343
 
 There was some discussion about a related posting I made to
 gcc@gcc.gnu.org.
 
   http://gcc.gnu.org/ml/gcc/2002-04/msg00838.html
 
 Especially,
 
   http://gcc.gnu.org/ml/gcc/2002-04/msg00899.html
 
 - Hari
 -- 
 Raja R Harinath ------------------------------ harinath@cs.umn.edu
 "When all else fails, read the instructions."      -- Cahn's Axiom
 "Our policy is, when in doubt, do the right thing."   -- Roy L Ash


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: c/6343: attribute((weak)) not working on second declaration
@ 2002-04-23  6:14 jason
  0 siblings, 0 replies; 6+ messages in thread
From: jason @ 2002-04-23  6:14 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, harinath, jason, nobody

Synopsis: attribute((weak)) not working on second declaration

Responsible-Changed-From-To: unassigned->jason
Responsible-Changed-By: jason
Responsible-Changed-When: Tue Apr 23 06:14:23 2002
Responsible-Changed-Why:
    got it

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6343


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: c/6343: attribute((weak)) not working on second declaration
@ 2002-04-23  1:52 mmitchel
  0 siblings, 0 replies; 6+ messages in thread
From: mmitchel @ 2002-04-23  1:52 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, harinath, nobody

Synopsis: attribute((weak)) not working on second declaration

State-Changed-From-To: open->analyzed
State-Changed-By: mmitchel
State-Changed-When: Tue Apr 23 01:52:12 2002
State-Changed-Why:
    Confirmed as regression from GCC 3.0.4.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6343


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-05-01 18:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-17 18:06 c/6343: attribute((weak)) not working on second declaration harinath
2002-04-23  1:52 mmitchel
2002-04-23  6:14 jason
2002-04-23  7:36 Raja R Harinath
2002-04-23 13:36 jason
2002-05-01 11:05 sirl

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).