title: How to make gcc linker output section size at command line?
body: <p>I program for MCUs. The size of code and data is important and I need to know the size of these section after compiling. I've known how to get these imformation. Just define </p>
  
  <pre><code>__text_size = SIZEOF(.text);
  </code></pre>
  
  <p>in the linker script file, and than I can get the value of it in the map file output by the linker. (the ".text" is a section defined in my linker script file).
    However, I hate to open the map file and search for the __text_size every time after compiling and linking. 
    Is there any way to tell the linker to output the size of a section at command line? The Keil, for example, always output the code, rodata, data and zi-data size after compiling.</p>