| |||||
Technical Support Support Resources
Product Information | LX51: LINKER LEAVES BIG GAPS IN MEMORY WHEN USING _AT_Information in this article applies to:
QUESTIONI'm building a project with PK51 V7.02b and extended linker enabled (LX51 V3.51p). This project has 62K of xdata variables, some of those variables were declared using the _at_ keyword, to put them in a specific address like 4B70H and 4FA0H, and I've notice a big gap in xdata before those _at_ variables. The linker is not placing variables before those _at_ variables and a lot of space is wasted. The old C51 V7.01 doesn't show the same behavior. Here's the map file showing the gap under V7.02b: * * * * * * * * * * * X D A T A M E M O R Y * * * * * * * * * * * * * 003430H 003631H 000202H BYTE UNIT XDATA ?XD?HELLO 003632H 004B6FH 00153EH --- --- **GAP** 004B70H 004B71H 000002H BYTE OFFS.. XDATA ?XD?HELLO?0 004B72H 004F9FH 00042EH --- --- **GAP** 004FA0H 004FA1H 000002H BYTE OFFS.. XDATA ?XD?HELLO?1 004FA2H 0051A1H 000200H BYTE UNIT XDATA ?XD?TEST1 0051A2H 0055A1H 000400H BYTE UNIT XDATA ?XD?TEST2 0055A2H 005FA1H 000A00H BYTE UNIT XDATA ?XD?TEST3 In the example above, ?XD?TEST1, ?XD?TEST2, ?XD?TEST3 should be placed before ?XD?HELLO?0, but they are not. The following is the correct behavior when I use C51 V7.01, for example: * * * * * * * * * * * X D A T A M E M O R Y * * * * * * * * * * * * * 003430H 003631H 000202H BYTE UNIT XDATA ?XD?HELLO 003632H 003831H 000200H BYTE UNIT XDATA ?XD?TEST1 003832H 003C31H 000400H BYTE UNIT XDATA ?XD?TEST2 003C32H 004631H 000A00H BYTE UNIT XDATA ?XD?TEST3 004632H 004B6FH 00053EH --- --- **GAP** 004B70H 004B71H 000002H BYTE OFFS.. XDATA ?XD?HELLO?0 004B72H 004F9FH 00042EH --- --- **GAP** 004FA0H 004FA1H 000002H BYTE OFFS.. XDATA ?XD?HELLO?1 Is it a problem with the tools or am I missing something? ANSWERThis was a problem with the LX51 Linker that has been corrected. You may download the latest updates from the Keil Website. Last Reviewed: Friday, July 15, 2005 | ||||
| |||||