This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: fix weak-5 on alpha


On Wednesday 15 May 2002 19:45, Richard Henderson wrote:
> On Wed, May 15, 2002 at 07:18:53PM +0200, Franz Sirl wrote:
> > Have you tried recompiling glibc with that patch?
>
> Nope.
>
> > That's what the vfoo1l test is all about.
>
> Then glibc needs to be fixed.  assemble_alias emits a definition that
> on some systems cannot be weakened after the fact.  Thus the abort on
> Alpha.  It should also have failed on Irix, though I didn't check
> gcc-testresults.

OK, but you explain it to Uli or fix it yourself ;-). David raised a similar 
issue for AIX, so you are probably right. I wish binutils would be stricter 
(at least warningwise), that would have prevented a lot of last-minute 
problems with my weak patch. 

> > And why wouldn't you warn on vfoo1c? That's exactly the situation that
> > triggered all this weak stuff.
>
> Huh?  Surely not.  If I warn for the vfoo1c case, I get oodles
> of warnings in the bootstrap.  Point me to the original thread?

Remember:

extern int __cxa_atexit (void (*func) (void *), void *arg, void *d);
extern void *__dso_handle;
int
atexit (void (*func) (void))
{
  return __cxa_atexit ((void (*) (void *)) func, ((void *)0) ,
                       &__dso_handle == ((void *)0)  ? ((void *)0)  : 
__dso_handle);
}
extern void *__dso_handle __attribute__((weak));

Basically at the time the RTL for the atexit function is generated, the 
compiler must be able to attach SYMBOL_REF_WEAK to the __dso_handle 
SYMBOL_REF, otherwise the function may be miscompiled. If you set DECL_WEAK 
after RTL has been emitted, it will go wrong.

Actually I wonder why you get warnings during bootstrap, I bootstrapped 
mainline yesterday on powerpc-linux-gnu with glibc-2.2.5-34 and 
binutils-2.12.90.0.7-1 without a single weak warning.

Franz.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]