SPRUIG8I January 2018 – December 2023
With ELF conditional linking, a code or data section will not be included in a link unless at least one symbol in that code or data section is referenced.
You can use the RETAIN pragma (Section 5.8.31) to force the section that contains a specific symbol to be included in the link. The CLINK pragma (Section 5.8.2) indicates that the section that contains the definition of this symbol is eligible for removal during conditional linking. You can use the CODE_SECTION (Section 5.8.5) and DATA_SECTION (Section 5.8.8) pragmas to force a symbol to be allocated in a particular section. The symbol must be referenced in a statement other than its declaration to force that section to be included in the link.