This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Miscompilation of glibc with CVS mainline
- From: Richard Henderson <rth at twiddle dot net>
- To: John David Anglin <dave at hiauly1 dot hia dot nrc dot ca>
- Cc: prj at po dot cwru dot edu, gcc at gcc dot gnu dot org, libc-alpha at sources dot redhat dot com
- Date: Thu, 2 Jan 2003 17:34:22 -0800
- Subject: Re: Miscompilation of glibc with CVS mainline
- References: <20030102141018.A20498@twiddle.net> <200301030102.h0312IXQ012013@hiauly1.hia.nrc.ca>
On Thu, Jan 02, 2003 at 08:02:18PM -0500, John David Anglin wrote:
> Isn't it possible for both a global define and weak defines to occur
> when a program is linked without incuring an error in the system V ABI?
Sure.
However, a strong use of a symbol *always* requires the symbol
to be defined. If GCC sees that a symbol is used, and it is
not declared weak, then it knows that that symbol *must* be
defined. The weakness of the definition doesn't enter into it.
> I think Ulrich has a point in questioning whether the optimization is
> useful.
On the contrary. The optimization is *extremely* useful.
Just as useful as exposing the .hidden directives to the
compiler.
> To get the old behavior users are now forced to use
> something like gcc's TARGET_ATTRIBUTE_WEAK macro.
Yes. IMO code that used inline assembly for this was simply broken.
r~