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.

Link failing for bios .trace section

Other Parts Discussed in Thread: TMS320VC5502

TMS320VC5502
Codegen 4.3.6
BIOS 5.41.07.24

Here's the relevant snippet from the BIOS generated linker command file:


        .trace: block(0x20000) fill = 0x0 {
           _SYS_PUTCBEG = .;
           . += 0x0;
           _SYS_PUTCEND = . - 1;
        } > SDRAM PAGE 0


Here's the corresponding linker error:

"./2490Gcfg.cmd", line 373: error: placement fails for object ".trace", size
   0x0 (page 0).  Available ranges:
   SDRAM        size: 0x2a0000     unused: 0x273570     max hole: 0x27356e 
error: errors encountered during linking; "2490G_TachyB.out" not built

So how on earth does the link fail for something of size zero?!  How do I resolve this linker error?

Thanks,
Brad

 

  • I cannot reproduce this error.  We'd need a more complete test case, including the command-line options you used.  I'd guess you are running afoul of the fact that objects are not allowed to cross 64k-word page boundaries, and somehow the linker is not noticing the section is of size zero before concluding from the blocking that it is impossible.

  • Good thought but  I'm not sure that's the issue.  Right now the memory map for this project is broken into 64k-word sections to make it impossible for anything to be linked such that it crosses a boundary.  We even temporarily modified the linker command file to make the suspect piece point into a completely unused section, i.e. the entire 64k-words was free, but even that didn't fix the error.  ?

  • Okay, I'm now able to reproduce the error.  The key to reproducing this error is to set SDRAM to a very large address.  It has nothing to do with the blocking factor.  This appears to be a linker bug.  I've submitted SDSCM00038639 to track this bug.

    The linker doesn't properly handle incrementing DOT by zero.  The workaround is to remove the useless increment of zero manually.

     

  • Brad --

    That section is used for the SYS_printf() buffer.   By default SYS_printf() puts characters into this circular buffer using the default SYS->PUTCFXN.   When you halt the target, you can view the characters in a memory window.  I think a better workaround would be to set this buffer to size to 4 or 8.  Not sure if it has to be a power of 2,but I like powers of 2.    Then you won't have to modify the generated .cmd file and worry about it being overwritten.  The config parameter to change this size should be in the SYS module.

    -Karl-

  • Yep, that's it.  If I go to System -> SYS -> Properties in the BIOS GUI then I can reproduce this issue by setting the size to 0 and the location to SDRAM (though I see warnings about spanning page boundaries which I didn't see at the customer).  Changing the size to 4 gets rid of the issue (by avoiding the linker bug).

    Thanks a lot Archaeologist for tracking down the linker error, and thanks Karl for helping me find an easy workaround!

    Best regards,
    Brad