I'm using Microchip's MPLAB IDE 6.20 to link several assembly routines into a control program for a system bus/memory interface. Everything would be fine, but when I run a Build All, I get the following error message:
Error - section 'GLOBALS' has a memory 'static' which can not fit the section. Section 'GLOBALS' length=0x00000028.
Meanwhile, the relevant lines from my linker command file are
DATABANK NAME=static START=0x0C END=0x0F DATABANK NAME=temp START=0x10 END=0x1F ... Other DATABANKs SECTION NAME=GLOBALS RAM=static SECTION NAME=TRANSACTION RAM=temp ... Other SECTIONS
I declare all the variables that go into these sections in a common header file that I include for each assembly module. The assembly modules declare no other variables - they're all brought in via the header. So, the key lines in the header file are:
GLOBALS idata
CMD_INT res 1 SWITCH_INT res 1 USR_INT res 1 RA_INT res 1
TRANSACTION idata
TGTADR_M1 res 1 ...Other variables
It seems to me that the GLOBALS section is as long as it needs to be - 4 byte-length values occupying addresses 0x0C - 0x0F. But somehow the linker seems to think I have 40 bytes! What's going on? How do I fix my files so that the linker does it right?
Thanks for any help.