Re: about making library
shiva said:
hello
i want to know how C library is made.what are the basic properties of a library.
i want to make my own library of my c code the how to do that.
i want it,s deassembly should not be available to the user...
There exist
nothing like C library in fact (corresponding to your idea). Your question implies that you want to store your C source code somewhere. Realize that C code = C
source code! I think the term 'C library' is a bit confusing thing because there is nothing like C code in such a library. Actually, when you compile a C code module, compiler compiles it to a relocatable assembly code module first (mostly). Then this code is assembled to a machine code module and stored usually in an object file as an object module. In the end, when building the final executable (machine) code, a linker (linking program) must link particular object modules (that the project in question consists of) together and locate them into available memory space (i.e. to determine their address ranges, recalculate jump and call addresses, etc.).
Finally, back to the topic - a (code) library file is nothing else than a 'container' file for useful
object modules (to be easily reused) and it is one of the input files for the linker. It has practically "nothing in common" with the original C source code (=text) in the sense that there exists nothing like decompiler. It means there is
no 'machine' way to get the C
source code back from the object format!
Note: object modules can be simply extracted from a library (utilities like LIB51, LIBX51, when MCS-8051 is concerned) and
no force can prevent from disassembling them if someone wants to. The result of disassembling is, however, only an assembly source code, of course!
It's a different issue if you want to protect your executable codes...
Best Regards
Eric