|ARM Technical Support Knowledge Articles|
Applies to: BL51 Code-banking Linker/Locator
Information in this article applies to:
I notice that the linker map file identifies some variables as type SYMBOL instead of PUBLIC even though I've declared them the same way as other PUBLIC variables. A sample declaration occurs below:
#define MAX_MESSAGE_LENGTH 0x40 static xdata unsigned char pkt_start; static xdata unsigned char temp_msg[ MAX_MESSAGE_LENGTH + 2 ];
What am I doing wrong?
The static keyword causes these variables to be identified as SYMBOL instead of PUBLIC. And, that is correct, variables declared with the static keyword are not PUBLIC. Although, access to the variables in either case follows the normal rules of scope.
Removing the static keyword from the declarations renders the desired output in the memory map for a global declaration of the variables. Remember, the static keyword excludes a variable from overlay analysis and limits the scope to the current file or function.
Article last edited on: 2005-02-05 14:56:28
Did you find this article helpful? Yes No
How can we improve this article?