ARM Technical Support Knowledge Articles

SYMBOL VS PUBLIC VARIABLES

Applies to: BL51 Code-banking Linker/Locator

Answer


Information in this article applies to:


SYMPTOMS

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?

CAUSE

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.

RESOLUTION

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

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential