title: GNU ld removes section
body: <p>I'm writing a boot script for an ARM-Cortex M3 based device. If I compile the assembler boot script and the C application code and then combine the object files and transfer them to my device everything works.</p>
  
  <p>However, if I use <code>ar</code> to create an archive (libboot.a) and combine that archive with the C application there is a problem:</p>
  
  <p>I've put the boot code in a section:</p>
  
  <pre><code>    .section    .boot, "ax"
      .global     _start
  
  _start:
      .word       0x10000800  /* Initial stack pointer (FIXME!) */
      .word       start
      .word       nmi_handler
      .word       hard_fault_handler
      ... etc ...
  </code></pre>
  
  <p>I've found that <code>ld</code> strips this from the final binary (the section "boot" is not available). This is quite natural as there is no dependency on it that <code>ld</code> knows about, but it causes the device to not boot correctly.</p>
  
  <p>So my question is: what is the best way to force this code to be included?</p>