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.

Linker Error - References from discarded sections



I am trying to build one application in CCS5.1 for C674X DSP on TI814x.
It links to 4 different libraries.

When I build all the libraries in COFF and the application also in COFF, everything is building fine. [ The project was earlier built in CCS3.3 in COFF, so I tried first building it in coff in CCS5.1]

When I build the libraries in ELF, they are building properly.

The application code is compiling properly, but at the time of linking it shows:

<Linking> fatal error #10232: relocation type "R_C6000_ABS32" in file "E:/../lib/import/ialg_mpeg4_dec.lib" at offset 0x0000012c in section ".debug_info" references symbol  "__TI_DW.debug_info.E:/../include/private/xdm_idma_fxns.h.d70e9972ea84ea3dd357769c299e1565" in discarded section with id (965); references to this symbol from this location are not allowed.

As I interpret, here the "ialg_mpeg4_dec.lib" is referencing the symbol "__TI_DW.debug_info.E:/../include/private/xdm_idma_fxns.h.d70e9972ea84ea3dd357769c299e1565" in "xdm_fxns.h" (which is part of another library called my_xdm_fxns.lib). Is this correct?

I checked that this symbol is present in the symbol table for "my_xdm_fxns.lib" [with giving -s option in the archiver command].

What is the meaning of "discarded sections" and what can be done to solve this issue?

CCS5.1 Application project build options used for ELF format:
Output Format: ELF
C6000 Compiler Options > Runtime Model Options > Application Binary Interface (--abi) = eabi
C6000 Compiler Options > Assembler Options > “Aid for transitioning hand-coded assembly from COFF to ELF (--strip_coff_underscore)” enabled

CCS version: 5.1.0.09000
CGTools version: 7.3.1

Thanks in advance,
Abhishek

 

  • Abhishek,

    There are a couple of related threads but it looks like we'll need more information or a reproducible test case to investigate further.

    http://e2e.ti.com/support/development_tools/compiler/f/343/t/193543.aspx
    http://e2e.ti.com/support/development_tools/compiler/f/343/t/191377.aspx

    Are you using the TI compiler and linker to build the libraries and application?

  • Hi AartiG,
    The libraries and application both are totally being built and linked in CCS 5.1 (CGTool version 7.3.1 ).

    I have gone through the same threads. They suggest "extracting all of the library files from the archive and linking with those instead of the library". Does it mean while building the app, I try to link all object files used to build and link the libraries instead of the actual library?

    Can you explain what the "discarded section" means?

    The application is building and working perfectly in COFF. So it seems like while building in ELF the stated symbol was "discarded". Can you make out something from this?

    Sorry, but I cannot share the libraries or app and it is very difficult to reproduce the problem since I don't know what is causing the issue.

  • We don't know what the problem is, either, because we can't get a test case.

    I think you can ignore the suggestion to extract the files from the library; I gave that advice when I thought this might be an isolated problem.

    "discarded section" means there was a section appeared in an input file, but got deleted because the linker thought it was unused.  The linker will not discard section A if there is a relocation in section B (that did not get deleted) which refers to section A.  The fact that you are getting this message is probably a bug of some sort.

    In your test case, both section A and section B are debugging information sections.  If you compile with debugging disabled, you probably won't get the error.

    Could you run "ofd6x -gv my_xdm_fxns.lib" and post the results here?  Be sure to attach it as a file, as this output would be very, very long.