SPRUI04F july 2015 – april 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 7.9.30) to force the section that contains a specific symbol to be included in the link. You can use the CODE_SECTION (Section 7.9.3) and DATA_SECTION (Section 7.9.6) 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.