Hiding Symbols in Static Libraries
When I am writing static libraries, I try to minimize namespace pollution as much as possible by taking care not to export all sorts of silly little global symbols all over the place. But in some situations, there is no way to avoid having a symbol exported from a library, even though the symbols don't actually need to be used outside of the library (e.g. source code generated by other programs that I don't have much control over, or pre-compiled third-party libs).
Is there any way to have ar/ranlib -not- place certain symbols in the table of contents when I build the library? I have tried using objcopy to "filter" symbols out of the library but I could not get it to work like I wanted, the symbols still were being exported, according to nm.
If hiding the symbols completely is not an option, is there some way to alias the symbols to different names in the archive?
Last edited by JCipriani; 03-02-2006 at 09:42 PM.