ARM Technical Support Knowledge Articles

ERROR/WARNING ON SYMBOL DEFINITION

Applies to: LX51 Linker/Locator

Answer


Information in this article applies to:


QUESTION

I am using a SmartMX controller that includes an SFR register with the name EXCINFO. Now I have also defined a public variable with the name Excinfo. It appears that this causes the following linker errors:

*** ERROR L104: MULTIPLE PUBLIC DEFINITIONS
    SYMBOL:  EXCINFO

*** WARNING L46: SFR SYMBOL HAS DIFFERENT VALUES
    SYMBOL:  EXCINFO

What is the reason for this errors?

ANSWER

The C51 and CX51 compiler is only case sensitive at C source level. At linker level the public symbols are not case sensitive. This is required to provide compatibility to assembler code, where all symbols are not case sensitive.

Therefore, you need to avoid defining identical symbol names that are public. You may for example define symbols using the static keyword to avoid such problems.

Example:

static unsigned char Excinfo;  // now the symbol is not PUBLIC

Article last edited on: 2007-01-08 14:33:29

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