title: What does KEEP mean in a linker script?
body: <p>The <a href="http://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_mono/ld.html#SEC2">LD manual</a> does not explain what the <code>KEEP</code> command does. Below is a snippet from a third-party linker script that features <code>KEEP</code>. What does the <code>KEEP</code> command do in <code>ld</code>?</p>
  
  <pre><code>SECTIONS
  {  
      .text :
      {
          . = ALIGN(4);
          _text = .;
          PROVIDE(stext = .);
          KEEP(*(.isr_vector))
          KEEP(*(.init))
          *(.text .text.*)        
          *(.rodata .rodata.*)        
          *(.gnu.linkonce.t.*)
          *(.glue_7)
          *(.glue_7t)
          *(.gcc_except_table)
          *(.gnu.linkonce.r.*)
          . = ALIGN(4);
          _etext = .;
          _sidata = _etext;
          PROVIDE(etext = .);   
              _fini = . ;
                  *(.fini)
  
      } &gt;flash
  </code></pre>