Hello,
Normally the linker throws out functions which are not called. --unused_section_elimination = on (default)
However, if I specify a section that is used for both called foo1() and not called functions foo2(), both functions are linked regardless.
I guess you can say that the #pragma section is used so will not be removed but equally unused functions are still removed when the default section (.text) is used.
<Question>
Is there a way to prevent linking of foo2() with compiler options without changing the code in the second case please?
The background is that this is a problem for AUTOSAR Memory Mapping system including the TI provided MCAL (e.g. Adc_MemMap.h) where scope for modifying code is limited. Because all functions share a common #pragma section, all unused functions are linked thus inflating the program size unnecessarily.