This is the mail archive of the libc-help@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]

linker errors when compiling and linking with a new glibc


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 libc.so under the main directory of the glibc tree and libpthread.so under nptl. If I do a "nm libpthread.so | 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 libpthread.so | 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? (Note: When I compile I do point gcc to my custom glibc...) I'm able to compile code that uses things that I have not added like plain "pthread_mutex_init() and I'm also able to run Linux binaries like "/bin/cat" using my new library with the "testrun.sh" that comes with the glibc tree.

Thanks for the help in advance,

Daniel   



      


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