This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Does weak work on PPC with -O2?
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Does weak work on PPC with -O2?
- From: "H . J . Lu" <hjl at gnu dot org>
- Date: Sun, 11 Mar 2001 15:44:33 -0800
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);
}