title: GCC --gc-sections and finding symbol dependencies
body: <p>I'm trying to reduce the size of my elf executable.  I'm compiling with <code>-ffunction-sections</code> <code>-fdata-sections</code> and linking with <code>-gc-sections</code>, but it appears some of the symbols that I believe are unused are not being discarded.</p>
  
  <p>Is there some command in the GNU toolchain I can run to find out which symbols are being used and where?</p>
  
  <ul>
  <li>Toolchain: GNU arm-none-eabi </li>
  <li>Platform: Cortex-M4 </li>
  <li>Language: C++</li>
  </ul>
  
  <p>Here are my typical build flags:</p>
  
  <p>Compilation: <code>arm-none-eabi-g++.exe -Wall -O3 -mthumb -std=c++11 -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -fsingle-precision-constant -ffunction-sections -fdata-sections</code></p>
  
  <p>Link: <code>arm-none-eabi-g++.exe -static -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -Wl,-gc-sections -Wl,-T"LinkerScript.ld</code></p>
  
  <p>Thanks for the help.</p>