Miscompilation of glibc with CVS mainline
Richard Henderson
rth@twiddle.net
Fri Jan 3 01:36:00 GMT 2003
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~
More information about the Libc-alpha
mailing list