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.
Tool/software: TI C/C++ Compiler
Greetings,
I generated a linker command file using a union construct. In the hopes of not needing to specify the object file etc for each entry in the union, I tried removing that information. The linker accepted it and produced the output. Is this the expected result? If the code contained more than one place with a given name, would they simply be concatenated? I guess I’m going beyond the basics now. Is there any documentation which could help? The syntax used is below:
UNION
{
NAME1
NAME2
} > MEMORY_VALUE, PAGE = 1
Thank you,
Ed
Hello Ed,
You can look at the below 2 links to understand this better,
processors.wiki.ti.com/.../C28x_Compiler_-_Understanding_Linking
Hope this helps.
Hi Karthik,
The website has some good introductory information. I have been using spru513s.pdf, a bit more recent, and all the examples of UNIONs include the {<Object File Name>(<Section Name>} construct. In our case, we want to omit that construct, and use the DATA_SECTION pragma name only so that we do not need to specify an object file. This would allow us to use the same cmd file in projects which define that space using different object files.
Trying it with the omission seems to work (We need to do more testing.). So I am looking for some documentation which confirms that this, indeed, will work.
Thank you,
Ed
Another good introduction article is Linker Command File Primer. Focus on the first half.
The following is valid ...
Ed Sanders said:UNION
{
NAME1
NAME2
} > MEMORY_VALUE, PAGE = 1
Here is what it does. A UNION is a collection of output sections that all start at the same address. That is, the output sections are overlaid on top of each other in memory. The linker provides no features for managing this overlay. That remains the responsibility of the team which implements the program. NAME1 creates an output section of that name. It is made up of all the input sections also named NAME1. The same is true of NAME2. This UNION is allocated to the memory range named MEMORY_VALUE located on PAGE 1.
Thanks and regards,
-George