linker errors when compiling and linking with a new glibc

Ryan Arnold
Wed Mar 18 16:51:00 GMT 2009

On Mon, Mar 16, 2009 at 6:16 PM, Daniel De La Zerda
<> wrote:
> I'm new to this so please be patient. I added a function pthread_foo_init() in foo.c with it's respective foo.h under the nptl directory. Then edited the Makefile inside the same directory to reflect these changes. After this I ran make and my new glibc built with no errors at all. I have the under the main directory of the glibc tree and under nptl. If I do a "nm | grep pthread_mutex_init" I see that the pthread_mutex_init symbol is global and not static - indicated by the "T" right before the function name. When I do "nm | grep pthread_foo_init" I see that it has a "t", and if I'm not mistaken, this means that it is local and static and that it cannot be seen by the outside world. Hence that's why I think I get linker errors when I try to compile a test program that uses my "pthread_foo_init()" saying that I have an "undefined reference to `pthread_foo_init`". Does anyone have any idea how I can solve
>  this problem?


Did you add pthread_foo_init to the export list in the nptl Versions file?

If not, then you won't get an external symbol for it.

Ryan S. Arnold

More information about the Libc-help mailing list