This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Undefined weak symbols stay undefined
- From: Momchil Velikov <velco at fadata dot bg>
- To: binutils at sources dot redhat dot com
- Date: 25 Nov 2003 11:57:32 +0200
- Subject: Undefined weak symbols stay undefined
$ cat x.c
extern int foo () __attribute__ ((weak));
int
main ()
{
if (foo)
foo ();
return 0;
}
$ gcc -static x.c
$ readelf -s a.out | grep foo
1257: 00000000 0 NOTYPE WEAK DEFAULT UND foo
Aren't undefined weak symbols supposed to be _defined_ to zero by
the linker, probably putting them in SHN_ANS ?
~velco
PS. This is binutils 2.14 20030612.