Re: Weak symbols not overriden

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Pan ruochen <panruochen@xxxxxxxxx> writes:

> I find there are some symbols with the same names existing both in libc
> and in libpthread. All these symbols are weak. I guess the libpthread
> provides multi-threading safe functions rather than libc provides
> single-threading versions. But since all these symbols are weak, how the
> dynamic loader choose the symbol in libpthread if libpthread is linked
> against the application?
>
> $nm -D libpthread.so.0 | grep '\<sendto\>'
> 00010d54 W sendto
> $nm -D libc-2.8.so | grep '\<sendto\>'
> 000e0704 W sendto

I have to encourage you to send glibc questions to the glibc mailing
list, rather than to the gcc and binutils mailing lists.

As far as I know, it works because programs link against libpthread
before they link against libc, so the dynamic linker searches libpthread
first.

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux