Typical message

 <Linking>
 error #10198-D: no input section is linked in

What it means

The linker has not found any “referenced” input sections to retain for the output file.

Why is it happening

A likely scenario for this message to appear is if you are building an ELF project with only assembly source files that do not have any "referenced" sections. This is a fundamental difference between COFF and ELF. COFF retains all sections by default. The opposite is true for ELF. In ELF, all sections are eligible for removal via conditional linking meaning that they will be removed if they are not referenced. If a section needs to be retained, the user must make sure that they are explicitly retained.

This would not be an issue with most C projects, as there is an entry point (defined by the C runtime library) which in turn calls main, and so sections will be pulled into the link. In the case of a single assembly source file, this is not the case.

Some background info on this is available here: https://processors.wiki.ti.com/index.php/C6000_EABI_Migration#Conditional_Linking_Feature This page was written for the C6000 tools but how the ELF/EABI feature works is the same for other devices as well.

Remedy

To work around this bug, add below two directives to the assembly source file.
- .retain tells the linker to keep this section (.text)
- .retainrefs additionally tells the linker to retain sections that reference this.

 .cdecls C,LIST,  "device.h"
;------------------------------------------------------------------------------
            .text                           ; Program Start
            .retain 
            .retainrefs  
;------------------------------------------------------------------------------

Additionally, if you are seeing diagnostic 10202 for missing entry point, see here for more details.


Risks, Severity

An executable will not be created until this error is resolved.

E2e.jpg For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article Compiler/diagnostic messages/10198 here.