Keil Logo


Information in this article applies to:

  • C51 All Versions


Help! I get a linker warning:

Warning L6: XDATA Space Memory Overlap

I have multiple C files in my project and am using the _at_ keyword to declare a lot of XDATA variables at fixed addresses. What could be the problem?


When you use the _at_ keyword in your global xdata variables, make sure that you do not use the extern and _at_ in the same line. Your global variable declaration should look something like:

xdata unsigned char variable _at_ 0x8000;

This line should be in a .C file.

If you put the above declaration in a header (.H) file, you need to protect it from being declared in more than one file. This is required so there are not multiple declarations of the same variable at the same address.

If you refer to this variable in another C file, you must use the extern keyword. However, you cannot use the _at_ keyword or the associated address. Your extern reference will look like:

extern xdata unsigned char variable;

Notice that there can be no _at_ 0x8000 reference in this line of code.

An alternative solution is to use C MACRO definitions as defined in the header file ABSACC.h.


Last Reviewed: Monday, February 20, 2006

Did this article provide the answer you needed?
Not Sure
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.