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.

"warning: no matching section" and linker not placing sections in map

Hello all!

Interesting issue here. The attached command file yields "warning: no matching section"  for lines 5-6 and 12-15 (.text + .const) when linked. I'm using the subsection-splitting option (-mo) with Linux TMS320C55x C/C++ Compiler v4.4.0 and TMS320C55x Linker v4.4.0.

I've noticed that .text from libfoo file1.o does not appear in the map. When I use the 3.3.3 tools, all .text:* from libfoo file1.o are placed in SARAM2 as expected. Note that I don't encounter any issues with the 3.3.3 tools; everything links and is placed as expected.

Thanks TI!

Tim

SECTIONS
{
   .saramText: align 4
   {
      -llibfoo.a <file1.o> (.text)
      -llibfoo.a <file2.o> (.text)
      -llibfoo.a <file3.o> (.text)
   } > SARAM2

   .saramConst: align 4
   {
      -llibfoo.a <file1.o> (.const)
      -llibfoo.a <file4.o> (.const)
      -llibfoo.a <file5.o> (.const)
      -llibfoo.a <file6.o> (.const)
   } > SARAM3

   .saramBss: align 4
   {
     -llibfoo.a <file1.o> (.bss)
   } > SARAM2

   .cinit_foo: align 4 
   {
      _foo_cinit1_start =.;
      -llibfoo.a <file6.o> (.cinit)
      _foo_cinit2_start =.;
      -llibfoo.a (.cinit)
      fooTerm.o (.cinit)
   } > FDARAM1 | FDARAM2

   .cinit: align 4 
   {
      cinit_start = .;
      * (.cinit)
      cinit.o (.cinitTerm)
   } > FDARAM1

   .text:      align 4 {} > SARAM1 | SARAM2 | SARAM3

   .bss:       align 4 {} > DARAM1 | SARAM1 | SARAM2 | SARAM3
   .data:      align 4 {} > DARAM1 | SARAM1 | SARAM2 | SARAM3
   .const      align 4 {} > DARAM1 | SARAM2 | SARAM3
   .switch     align 4 {} > DARAM1 | SARAM1 | SARAM2 | SARAM3

}

  • Also, if I remove the "-mo" option on the 4.4.0 tools, everything works as expected. The "-mo" option works with the 3.3.3 tools.

    Tim

  • Except for the "no matching section" warnings, do you get a clean link?  If so, then you don't need any .text or .const from file1.o.  Your code must not make any references to the functions or data defined those sections from file1.o.  Does this make sense?

    Thanks and regards,

    -George

  • George-

    Thanks for the response!

    This was my initial assumption...  I checked and can see a straightforward code path to the unlinked code.

    One detail not mentioned in my first post; the linkage that I'm trying create is somewhat of a shared library. The libfoo.a and local object code are linked together to create a binary that can be loaded by an existing dsp image already running on a DSP. In the past ( less than 3.3.3) this hasn't been an issue.

    Is it possible with the 4.x+ tools, this case is now being optimized out?

    regards,

    Tim

  • Folks-

    Looks like what I wanted to do was create a relocatable binary. Adding the --relocatable flag to the linker forced the linker to place all necessary sections.

    Thanks!

    Tim