This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Address Overflow error for Code

I am using philips MC2 controller. Following are the memory classes defined:
ACTIVE MEMORY CLASSES OF MODULE:

BASE START END USED MEMORY CLASS
==========================================================
000000H 700000H 77FFFFH 00A2B6H HDATA
7F0000H 7F0000H 7F04FFH 000100H EDATA
000000H 000000H 0006FFH 000440H XDATA
910000H 910000H 91FFFFH 01000BH CODE
900000H 900000H 90FFFFH 0000FCH CONST
000000H 910000H FFFFFFH 01975FH ECODE
000000H 910000H FFFFFFH 000002H HCONST
000000H 900000H 90FFFFH 000EFDH ECODE_CFI
LX51 LINKER/LOCATER V3.60 10/09/2003
14:59:56 PAGE 4

7F0020H.0 7F0020H.0 7F002FH.7 000007H.3 BIT
7F0000H 7F0000H 7F007FH 000068H DATA
000000H 000000H 0000FFH 000005H PDATA
7F0000H 7F0000H 7F00FFH 000002H IDATA

I am getting address overflow error for code memory. If i remove some portion of code then it fits in the CODE memory Class. otherwise it overflows. The expectation is that the linker should be using ECODE instead. What can be reason ? I can only use memory in the range 0x900000-0xFFFFFF for code.

Parents
  • When i look at the memory map, I am finding things are not right. What i am not able to figure out is by the linker placing parts of the program in Code memory, even after it finds it has crossed 64k. I have explicity tried to place modules in ECODE memory Class by using directives
    #pragma USERCLASS (ECODE=OTHER)
    #pragma USERCLASS (ECODE=CFI)
    The(Mr.) linker still tries to put it in Code memory.

    Following are the memory setting which i am using

    HDATA(0x700000-0x77FFFF), EDATA(0x7F0000-0x7F04FF), XDATA(0x0000-0x06FF),
    CODE(0x900000-0x90FFFF), CONST(0x900000-0x900FFF),ECODE (0x910000-0xFFFFFF),
    HCONST(0x910000-0xFFFFFF), ECODE_CFI(0x910000-0x91FFFF),ECODE_OTHER(0x910000-0xFFFFFF).

    And below is the Memory Class section of the .map file.
    ACTIVE MEMORY CLASSES OF MODULE

    BASE START END USED MEMORY CLASS
    ==========================================================
    000000H 700000H 77FFFFH 00A2B6H HDATA
    7F0000H 7F0000H 7F04FFH 000100H EDATA
    000000H 000000H 0006FFH 000440H XDATA
    900000H 900000H 90FFFFH 01000BH CODE
    900000H 900000H 900FFFH 0000FCH CONST
    000000H 910000H FFFFFFH 003B8BH ECODE
    000000H 910000H FFFFFFH 000002H HCONST
    000000H 910000H 91FFFFH 000EFDH ECODE_CFI
    LX51 LINKER/LOCATER V3.60 10/10/2003 14:32:43 PAGE 4


    000000H 910000H FFFFFFH 015ACCH ECODE_OTHER
    7F0020H.0 7F0020H.0 7F002FH.7 000007H.3 BIT
    7F0000H 7F0000H 7F007FH 000068H DATA
    000000H 000000H 0000FFH 000005H PDATA
    7F0000H 7F0000H 7F00FFH 000002H IDATA

    In the project i have used lot of enums. Code variables are used but not many.

    Thanks in advance.
    sharad.

Reply
  • When i look at the memory map, I am finding things are not right. What i am not able to figure out is by the linker placing parts of the program in Code memory, even after it finds it has crossed 64k. I have explicity tried to place modules in ECODE memory Class by using directives
    #pragma USERCLASS (ECODE=OTHER)
    #pragma USERCLASS (ECODE=CFI)
    The(Mr.) linker still tries to put it in Code memory.

    Following are the memory setting which i am using

    HDATA(0x700000-0x77FFFF), EDATA(0x7F0000-0x7F04FF), XDATA(0x0000-0x06FF),
    CODE(0x900000-0x90FFFF), CONST(0x900000-0x900FFF),ECODE (0x910000-0xFFFFFF),
    HCONST(0x910000-0xFFFFFF), ECODE_CFI(0x910000-0x91FFFF),ECODE_OTHER(0x910000-0xFFFFFF).

    And below is the Memory Class section of the .map file.
    ACTIVE MEMORY CLASSES OF MODULE

    BASE START END USED MEMORY CLASS
    ==========================================================
    000000H 700000H 77FFFFH 00A2B6H HDATA
    7F0000H 7F0000H 7F04FFH 000100H EDATA
    000000H 000000H 0006FFH 000440H XDATA
    900000H 900000H 90FFFFH 01000BH CODE
    900000H 900000H 900FFFH 0000FCH CONST
    000000H 910000H FFFFFFH 003B8BH ECODE
    000000H 910000H FFFFFFH 000002H HCONST
    000000H 910000H 91FFFFH 000EFDH ECODE_CFI
    LX51 LINKER/LOCATER V3.60 10/10/2003 14:32:43 PAGE 4


    000000H 910000H FFFFFFH 015ACCH ECODE_OTHER
    7F0020H.0 7F0020H.0 7F002FH.7 000007H.3 BIT
    7F0000H 7F0000H 7F007FH 000068H DATA
    000000H 000000H 0000FFH 000005H PDATA
    7F0000H 7F0000H 7F00FFH 000002H IDATA

    In the project i have used lot of enums. Code variables are used but not many.

    Thanks in advance.
    sharad.

Children
  • The linker does not move segments from one memory space to another. It merges segments that are located in same memory class but it does not move them to a different memory class.

    The memory class (code, ecode, xdata, ...) of a segment is determined when that segment is created (in the assembler or in the compiler).

    When you looked at the Memory Map Of Module did you notice which of your program segments were located in CODE memory?

    Jon