Information in this article applies to:
I receive the following linker error when I compile and link my program:
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: DATA SEGMENT: _DATA_GROUP_ LENGTH: 0014H
This error message is generated when there isn't enough memory available for all the code and/or data segments in your program. The following sample program generates this error (when compiled and linked).
unsigned char data buffer2 [101]; void main (void) { long a, b, c, d, f; a = b = c = d = f = 0; // Avoid Compiler Warnings }
The best way to resolve this type of problem is to find out what's consuming all the memory. Look in the map (*.M51) file and locate the link map. It appears as follows:
LINK MAP OF MODULE: C:\TEMP\ASDF (ASDFASDF) TYPE BASE LENGTH RELOCATION SEGMENT NAME ----------------------------------------------------- * * * * * * * D A T A M E M O R Y * * * * * * * REG 0000H 0008H ABSOLUTE "REG BANK 0" DATA 0008H 0065H UNIT ?DT?ASDFASDF IDATA 006DH 0001H UNIT ?STACK
The error message...
*** ERROR 107: ADDRESS SPACE OVERFLOW SPACE: DATA SEGMENT: _DATA_GROUP_ LENGTH: 0014H
specifies that a 14h byte long segment named _DATA_GROUP_ can't fit in the remaining DATA space. Referring to the link map, the DATA space starts at 8h and has a single segment ?DT?ASDFASDF that occupies 65h bytes. Since the DATA space is 80h bytes max., we can calculate the space remaining as 80h - (8h+65h) = 80h - 6Dh = 13h. So, there are only 13h bytes left in the DATA space. Since the _DATA_GROUP_ is 14h bytes long, it can't fit in the remaining 13h bytes.
If the memory space is DATA, you should look for the largest DATA segments. If they are static or global buffers, you may want to consider moving them to XDATA memory to conserve the DATA space.
文章评论(0条评论)
登录后参与讨论