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.
I want to place an object file, which is contained inside a library into a named section.
I try the example given in spnu188i ARM Assembler Tools Manual:
SECTIONS
{
boot > BOOT1
{
-l=rts32e.lib<boot.obj> (.text)
}
}
The linker gives me 3 error messages:
-l must specify a file
can not find file .text
can not find file boot.obj
The library is also included in the project (first line in linker cmd file). Without the Boot Section the program links without errors. Using CCS4.2.1.0004
Best regards
Ernst
Ernst,
The syntax as documented in the Users Guide does not work. We have captured it as an errata in the document:
http://processors.wiki.ti.com/index.php/TMS470_Assembly_Language_Tools_Errata
If you remove the '=' sign in the '-l=rts32e.lib<boot.obj> (.text)' it will work.
Thank You Aarti,
Sorry I did not do my homework carefully. It takes a bit of time to find all the resources available online.
Without the "=" the linker accepts the command, but now, on this same line I get a
Warning: No matching section found.
And the boot section is not allocated (also not listed in the map), boot.obj is placed in the .text Section. When i add one of my objects (e.g. main.obj) to the "boot" section, this one is allocated there, again the .obj from the library is not placed into the boot section.
I am using CCS 4.2 .1.00004 ; Linker: lnk470 V4.6.3; Compiling for a TMS320DM365. I tried upgrading to the latest CCS Version, but then my emulator (SEED XDS560PLUS) stopped working, so i reverted back to this older version. I will try to upgrade the Compiler tools only, hoping these do work with the older version of the DevEvnironment, too.
OS is WINXP-SP3, latest JAVA engine.
Linker Options: -rom-model , -c ; generate Map File, Link libc.a and a library path
Linker CMD File:
==========================
-l rts32e.lib
-stack 0x00000800 /* Stack Size */
-heap 0x00000800 /* Heap Size */
MEMORY
{
VECS: o = 0x00000000 l = 0x00000080
IRAM: o = 0x00000080 l = 0x00007f80
DDR2: o = 0x80000000 l = 0x4000000
}
SECTIONS
{
boot > IRAM { -lrts32e.lib<boot.obj> (.text) }
.text > IRAM
.bss > IRAM
.cinit > IRAM
.cio > IRAM
.const > IRAM
.stack > IRAM
.sysmem > IRAM
.data > IRAM
.ddr2 > DDR2
}
====================================
Interestingly when I remove the "boot" section and define the .text section like:
.text > IRAM {
-lrts32e.lib<boot.obj> (.text)
*.(text) }
Again, i see the Warning: "no matching section" on the library-line. However in this case the linker puts boot.obj from the runtime library as the first module into IRAM.
Basically this is what I want, but - due to the warning- i am not sure if this is just by accident or a reliable solution.
One thought was, that inside the library the sections had a different name than .text; but the map file shows e.g
.text 0x80; 048; rtsv5_A_le_eabi.lib: boot.obj (.text)
Best regards
Ernst
Ernst,
When you create a project in CCS, it defaults to an "automatic" runtime library selection, meaning that the tools will link in an appropriate runtime library based on your device and other selections (such as endianness, output formatc etc). In your case this is defaulting to rtsv5_A_le_eabi.lib (for ARM9, little endian, eabi selections that were picked during the project wizard). Since this library is picked on the command line prior to the linker command file (take a look at the build command in the console view), it is getting allocated first and then there is no matching boot.obj (.text) section when it encounters it in the linker command file.
If you want to use the rts32e.lib instead of letting the tools choose a default, pick that library in the Project Build Properties->CCS Build
When you do this you can comment out the " -l rts32e.lib" line in your linker command file and use this sytax to place boot.obj in a specific section:
boot > IRAM { -lrts32e.lib<boot.obj> ( .text) }
You may also want to consider using one of the rtsv5*.lib which would be more appropriate for your configuration, in which case you can just select the desired runtime library in the drop-down list shown above, and then modify the specification in the linker command file accordingly.
Thank You again Aarti,
Now I know how the library is actually picked. I copied the linker cmd file from an evaluation board test program.
I thought rts32e was a generic alias for a set of libraries, from which the linker would choose one based on some project settings.
Your answers were very helpfull !
Best regards
Ernst