This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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]

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.


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