This is the mail archive of the gcc-bugs@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]

Does weak work on PPC with -O2?


Does weak work on PPC with -O2 and above? Here is a testcase. I got
those on Linux/PPC with gcc 2.95.3:

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

It works fine on ia32.


-- 
H.J. Lu (hjl@gnu.org)
--weak.c---
#include <stdio.h>

extern void *foo __attribute__ ((__weak__));

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


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