Tool/software: TI C/C++ Compiler
Hello,
The other day, I ran into some unexpected behavior from the 8.2.2 linker, and I have attached a simple CCS project to demonstrate it. I was under the impression (perhaps incorrectly) that "more specific" input section specifiers take priority over "less specific" input section specifiers in a linker command file. For example, in the attached project, I have contrived a linker command file that allocates hello.obj (.const) to GROUP1 and hello.obj (.const:.string) to GROUP2:
...
18 GROUP1 > EXAMPLE_MEMORY
19 {
20 hello.obj (.const)
21 hello.obj (.far)
22 }
23
24 GROUP2 > EXAMPLE_MEMORY
25 {
26 hello.obj (.const:.string)
27 }
...
When I compile and link, I find that the section specifier on line 26 overrides the one on line 20, and therefore the constant string is allocated to GROUP2. This is what I expected to happen. However, if you change the linker command file as follows and rebuild:
...
18 GROUP1 > EXAMPLE_MEMORY
19 {
20 hello.obj (.const, .far)
21 }
22
23 GROUP2 > EXAMPLE_MEMORY
24 {
25 hello.obj (.const:.string)
26 }
...
...you will then find that the section specifier on line 20 overrides the one on line 25, and therefore the constant string is allocated to GROUP1. I was expecting these two linker command files to behave identically. I'm hoping that someone can explain why these linker command files behave differently; I haven't been able to find anything on my own.
Thanks in advance,
Dave