LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Hide local functions within a library generated by 'ar' (https://www.linuxquestions.org/questions/linux-newbie-8/hide-local-functions-within-a-library-generated-by-ar-164670/)

relzok 03-31-2004 03:51 PM

Hide local functions within a library generated by 'ar'
 
First, I'm a newbie....so I hope this isn't too dumb of a question!
I've got about 20 C files that I've compiled in the following way:

gcc -c file1.c
gcc -c file2.c .....

One of these C files holds the 'glue' or top level function calls that the outside world (library users) need to know about. The rest are used internally and I want to hide them from the user of the library.

For example, after I build my library using 'ar' to link all the object files together, I can dump the contents of the library using 'nm'. Here it lists all the function calls within the library. I only want the top level functions to be visible.

Is this possible? I tried 'strip' but then when I try to use the library, I get a segmentation fault.

Thanks for your help!


All times are GMT -5. The time now is 11:53 AM.