I was wondering if there is way to remove ALL the unused functions listed in the map file for an embedded project developed in C and using the IAR embedded workbench for ARM IDE, which uses its own compiler and linker:
IAR C/C++ Compiler for ARM 8.30
IAR ELF Linker for ARM 8.30
IAR Assembler for ARM 8.30
I have noticed that not all the functions listed in the map file are the used functions that actually are used at run time, is there any optimization way to remove all unused functions?
For example a third library is used in the project and FuncA()
is part of that inside which there might be a switch case and for every case a different static function in called, lets say FuncA1()
, FuncA2()
, ... FuncAn()
. We would enter each case based on the code and usage of the FuncA()
so it it obvious that not all of the FuncA1()
, FuncA2()
, ... FuncAn()
functions would be called in the project, however, all of them are listed in the map file.
Is it possible to remove such functions from the map file? If yes how?