This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
I am getting the following error:
"error: section ".const" (0x1fa0c) spans page boundary: not allowed before CPU revision 3.0"
Previously I had another section where I got this error and I could add the block(0x20000) directive so that it would not cross page boundaries. A similar block directive with the .const section seemed to have no affect. Also I did not see anything in the BIOS config other than specifying what section the .const section is allocated.
How can I get around this problem?
Thanks in advance. Jordon
Adding block(0x20000) should have been sufficient. How big is .const? Could you post the fragment of your linker command file which specifies block(0x20000) for .const?
Arch,
This is the line I added. It did not change the .const section location. Currently my .const section is allocated to SARAM in the BIOS config.
.const: block(0x20000) > SARAM
Thanks, Jordon
small, but you can see it starts just before the page boundary. From my map file:
output attributes/
section page orgn(bytes) orgn(words) len(bytes) len(words) input sections
-------- ---- ----------- ----------- ---------- ---------- --------------
:
:
.const 0 [ 0001fa0c ] 0000fd06 * 0000078a
I created a test case for this situation, and blocking works for me. What version of the linker are you using (look at the top of the map file)?
You were able to make a test case where your .const section crossed page boundaries?
******************************************************************************
TMS320C55x Linker PC v4.3.1
******************************************************************************
>> Linked Wed May 11 16:14:24 2011
Jordon said:You were able to make a test case where your .const section crossed page boundaries?
I'm not sure what you mean. It's easy to get the linker to allocate sections across page boundaries, but you want to prevent that, since it won't execute properly.
I made a test case where I had a small section which crossed a page boundary (which the linker correctly complained about), and adding block(0x20000) caused the linker to instead push the address of the small section up to the next page boundary. This demonstrates that block(0x20000) does what you need. This works for me for linker version 4.3.1.
Could you post the entire map file and linker command file, or attach them to a private conversation?
I think the problem I am having has to do with "internally managed" sections such as .const. I can get the block directive to work on sections that I define in my .cmd file. For example:
.daram_const: block(0x20000)
{
my.lib(.const)
} > DARAM
but I do not see that the following does anything to the "internal" .const section.
.const: block(0x20000) > SARAM
I just want to confirm that you used the block command on a section such as .const, .bss, etc. not a section you defined in your .cmd.
I appreciate you hanging in there with me...
Yes, my test case used ".const"
There should be no difference between ".daram_const" and ".const" as far as the "block" operator is concerned. It shouldn't matter whether the section is user-defined, generated by the compiler, or generated by the linker.
In the auto-generated XXXXcfg.cmd generated by the CGT, the .const section is not restricted to span page boundaries (i.e. it does not contain the block directive for the .const section) and I have found no way to override it in my .cmd file. The only way I found to make this work is to manually updated the XXXXcfg.cmd to add the block directive.
GROUP {
.const: block(0x20000) {}
.printf (COPY): {}
} > SARAM PAGE 0
I would think that the tools should use the block directive like the other sections:
XXXcfg.cmd:
:
SECTIONS {
.bss: block(0x20000) {} > DARAM PAGE 0
.hwi_disp_sec: block(0x20000) {} > DARAM PAGE 0
.far: {} > DARAM PAGE 0
.sysdata: block(0x20000) {} > DARAM PAGE 0
.mem: {} > DARAM PAGE 0
.cio: {} > DARAM PAGE 0
.sysregs: {} > DARAM PAGE 0
.data: block(0x20000) {} > DARAM PAGE 0
.gio: block(0x20000) {} > DARAM PAGE 0
.sys: block(0x20000) {} > DARAM PAGE 0
.pwrmdb: block(0x20000) {} > DARAM PAGE 0
GROUP {
.const: {}
.printf (COPY): {}
} > DARAM PAGE 0
: