Dear Dr. GUI,
We distribute Microsoft Win32 software in OBJ/LIB format. Is possible to remove the Common Object File Format (COFF) symbol tables for local variables/procedures?
Thanks in advance,
Maurizio Vairani
Dr. GUI replies:
Have you tried Dr. GUI's new cough elixir? Take one part Java and six parts single-malt Scotch . . . .
In general the COFF format does not have private symbolic information except static function names. The CodeView (CV) format, however, has private symbolic information about function names, local variables, type definitions, and so on. There are no application programming interfaces (APIs) to strip private COFF symbol information. There are, however, APIs in the IMAGEHLP.DLL to strip private CV symbolic information. One such API is RemovePrivateCvSymbolic(). The RemovePrivateCvSymbolic() API removes all but public information from the CV debug information. The intent is to allow the user to ship the debug symbols for an image without disclosing the data structures or source information. A consumer can only get a stack trace, place breakpoints on functions, and dump memory. Another IMAGEHLP API which does the same thing is SplitSymbols() (only if you specify the SPLITSYM_REMOVE_PRIVATE flag). These APIs are documented in the Platform Software Development Kit (SDK). Check the docs for these functions to decide which API you should use.