This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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]

calling an undefined weak symbol


Hi list,

In the function __libc_start_main we have those two lines:

extern void __nptl_deallocate_tsd (void) __attribute ((weak));
__nptl_deallocate_tsd ();

If I understand correctly, the function will call __nptl_deallocate_tsd,
which will have the value of the __nptl_deallocate_tsd function
if libpthread will be linked in, or zero if not (because this is a weak
symbol).
But, if libpthread is not linked in, then __libc_start_main will call
a value of zero which will make a Segmentation Fault !

Can you please explain this to me (I don't really think glibc creates
a segfault, I am sure I missed something here) ?

Thank you all,
Metuki


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