Hi All,
I would like to ask some questions on grammar of linker.cmd file, in particular, to Brad Griffis’s 6455 starter project example.
c6455.cmd said:MEMORY{L1P: o = 00e00000h l = 00008000h /* 32k */L1D: o = 00f00000h l = 00008000h /* 32k */L2: o = 00800000h l = 00200000h /* 2MB */}SECTIONS{vectors > 0x00800000, RUN_START(_ISTP_START).text > L2.stack > L2.bss > L2.cinit > L2.cio > L2.const > L2.data > L2.switch > L2.sysmem > L2.far > L2}
First, according to SPRU186s, TMS320C6000 Assembly Language Tools v 7.0 User's Guide, page 186:
SPRU186s, p. 186 said:“>” is used for allocating the section into a range defined in the MEMORY directive with the specified name (like SLOW_MEM) or attributes.
In SECTIONS, all other sections are allocated into L2, which is a “range” properly defined in MEMORY. But for the first line in SECTIONS:
c6455.cmd, first allocation line SECTIONS said:SECTIONS{vectors > 0x00800000, RUN_START(_ISTP_START)……}
Is 0x00800000 a range? It is a memory address alone, more close to “origin” in the “origin-length” pair in MEMORY. But if it is a single address, why the example still uses “>” here? Why it is not using
SPRU186s, p. 186 said:Binding: allocates a section at a specific address.
The second question is for RUN_START. Description for this can be found on p.205 of the same document, which says:
RUN_START( sym ) Defines sym with the run-time start address of related allocation unit
This is quite succinct and there is no example following directly applies to this c6455.cmd example. What does
1. sym
2. run-time start address
3. related allocation unit
mean, respectively?
And in main.c, the parameter of RUN_START(_ISTP_START) is referenced and used like this:
main.c beginning part said:extern far unsigned int ISTP_START;
extern cregister volatile unsigned int ISTP, IER, ISR, CSR;
void main(){// set Interrupt Service Table Pointer to start of vector tableISTP = (unsigned int)(&ISTP_START);……}
Since main.c can reference ISTP_START and assign its address to ISTP, which is CPU’s internal Interrupt Service Table Pointer Register , RUN_START must have somehow associated
1. Vectors
2. 0x00800000
3. START
together. In detail, how is this achieved?
Sincerely,
Zheng