I want to deliver a C static library and hide the internal implementation as much as possible. I am using a code obfuscator on my code and that works very well for making symbols incomprhensible for a human. I am using xcode 4 which I assume has GCC like flags.
My problem is that my library still contains readable informations that I would like to hide or make incomprehensible to human:
1- Object file names: When I run nm on the .a , I still see the names of each object file. (i.e myObect1.o myObject2.o etc). Is there a way to remove these names from my .a?
2- file paths: When I run strings on my library, I still see paths to headers files as well as some .c file paths (included as #include). Is there a way to remove these as well. (GCC flag or other way)?
Thanks for you help,
baba
ps: I know about nm and strings but if you know of any other tools or if you can suggest anything else I should check is properly hidden in my .a, all suggestion is welcome.
Consider distributing an amalgamation as SQLite does: http://www.sqlite.org/amalgamation.html. In other words, instead of a library, distribute a single .o file and a single .h file.
You'll have to annotate your internal functions as static. This will also give the compiler further opportunity for optimization. Lua uses such annotations. See for instance http://www.lua.org/source/5.1/ldo.h.html. For an amalgamation, LUAI_FUNC
is defined as static.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With