title: How to remove all the unused functions from the map file?
body: <p>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:</p>
  <pre><code>IAR C/C++ Compiler for ARM 8.30    
  IAR ELF Linker for ARM 8.30 
  IAR Assembler for ARM 8.30
  </code></pre>
  <p>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?</p>
  <p>For example a third library is used in the project and <code>FuncA()</code> is part of that inside which there might be a switch case and for every case a different <strong>static</strong> function in called, lets say <code>FuncA1()</code>, <code>FuncA2()</code>, ... <code>FuncAn()</code>. We would enter each case based on the code and usage of the <code>FuncA()</code> so it it obvious that not all of the <code>FuncA1()</code>, <code>FuncA2()</code>, ... <code>FuncAn()</code> functions would be called in the project, however, all of them are listed in the map file.</p>
  <p>Is it possible to remove such functions from the map file? If yes how?</p>