I am trying to build/use a custom lib. But, the code size is huge by custom lib included many functions. Some function is not call, but still take code space.
I can mark out uncalled function to release lib space and program size. But, that is troublesome.
Is any method to do for limited code space with a large custom lib?
Look at the Librarian commands: http://www.keil.com/support/man/docs/lib51/lib51_commands.htm
The Librarian works in terms Object Modules (ie, files) - not functions.
To be able to work with individual functions, you have to have each function in its own Object Module...
For some other projects (and other compiler tools), I did write a tool that splitted a source file during build process, so I could edit "normal-sized" source files containing collections of relevant functions, or maybe all methods for a C++ class.
During build, the compiler got to see many source files containing just one function or one C++ object method.
I made use of #define to give the tool hints about places to split or not split, since the tool did not understand static variables, and that functions accessing these must be compiled in same compilation unit.
Anyway - that concept saved quite a lot of code space for applications making use of the libraries, without making editing of the code a major pain.
Having linking of partial objects available in all linkers would sometimes be quite nice.
This is what I do now... But, it takes time for rewrite the lib and header files.
To Per Westermark: Can you post a smaple or link describe your idea?