We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
I have detected that some functions like this one are using their own XDATA space instead of using the XDATA_GROUP for local purposes:
for example this one:
void zmemcpy2(UINT8 *dst,const UINT8 *src, UINT32 len) { --dst; --src; while (len--) { *(++dst) = *(++src); } }
then this is the line in the m51 file:
XDATA 82C2H 000AH UNIT ?XD?_ZMEMCPY2?LIB
so then Im wasting ten bytes of global data space for just a memcopy. Why is this happening?
And here it is another weird thing: this function is never used by the rest of the program. It is compiled, but should not be linked. any idea?
thanks in advance...
A Library is a special type of object file specifically designed so that the Linker can pick out only those functions that are actually required;
Otherwise, in general, if you tell a Linker to include an Object file, it will do so - it's up to you not to tell the Linker to link unused stuff!
fully stated: "so that the Linker can pick out only those modules containing functions that are actually required"
you can easily get 'unused functions' from a library if the modules there contain more than one function.
Erik