Please test and report on other arches

Jack Howarth howarth@bromo.med.uc.edu
Mon Mar 12 10:25:00 GMT 2001


   In case folks haven't been reading the thread
'Does weak work on PPC with -O2?' thinking it
didn't impact their arch, could someone from each
arch (other than ppc and ia64) try HJ Lu's test
case for undefined weak symbols? The test is...


# gcc -O2 weak.c 
# ./a.out 
Segmentation fault (core dumped)
# gcc -O1 weak.c 
./a.out
foo: (nil)

for...

--weak.c---
#include <stdio.h>

extern void *foo __attribute__ ((__weak__));

main ()
{
  printf ("foo: %p\n", &foo == NULL ? NULL : foo);
}

...on ppc. It happens to pass by accident on ia64.
It would be helpful to have this tested performed
on both gcc 2.95.3 and gcc 3.0 branch if possible
on each arch to verify this problem is indeed 
cross-platform as suspected.
   This problem arises with the current glibc cvs

http://sources.redhat.com/ml/libc-alpha/2001-03/msg00016.html
http://sources.redhat.com/ml/libc-alpha/2001-03/msg00019.html
http://sources.redhat.com/ml/libc-alpha/2001-03/msg00020.html

and Ulrich insists we get gcc fixed rather than 
hack up glibc to work around this broken support
for undefined weak symbols at higher optimization
levels. Thanks in advance for any help from those
on other arches in verifying the extent of this
problem.
              Jack Howarth




More information about the Gcc-bugs mailing list