Background
I am using the GNU Tools for ARM Embedded Processors compiler, which is a GCC compiler. I am currently working in a Windows environment.
I am building a relatively large project, and have successfully compiled all the source code, but am facing a challenge during the link stage. This particular platform as two separate regions of RAM, and I need to map certain sections of the object code to specific regions.
I think I should be able to use a linker script such as:
SECTIONS
{
ER_CCM 0x10000000:
{
* (.bss)
}
ER_SRAM 0x20000000:
{
someLib.obj (.bss)
}
}
However, my problem is that the compiler is outputting .lib files (archives) instead of .obj files. The linker is being invoked in the current directory of all the archive files with the following syntax:
ld.exe --library-path=C:\SomePath\lib --Map C:\Somepath\bin\mapfile.map --script=C:\Somepath\bin\linkscript.ldf -( file1.lib file2.lib ... -)
Even though the .lib files contain references to the .obj files, the linker complains that it cannot find the file someLib.obj
probably because it does not have the full path given to know what file the mapping is referring to.
Supplying the linker with the full path in the linker script also does not appear to work; the symbols contained within the specified object file are still showing up in the first section of memory.
Questions
Is the syntax in the sample linker script valid? Will the wildcard in the first section prevent the specified file in the section section from being mapped correctly?
How can I specify to the linker to take certain object files within archive files to map to specific regions? Is this even possible?