title: conditional statements for linker command language LD
body: <p>Are there conditional statements for the GNU LD linker command language?</p>
  
  <p>Context: I am developing firmware for an arm cortex m0+, which consists of a bootloader and an application. Both are compiled and flashed to target in separate projects, but I use a framework with symbolic links to the drivers, makefile and loader scripts so that I can reuse those for every app I make without copying these files for each app. 
  Currently I have two loader files, for bootloader and application (makefile automatically specifies the appropriate one), with memory assigment as follows:</p>
  
  <p><em>bootloader</em></p>
  
  <pre><code>MEMORY { 
    flash (rx)  : ORIGIN = 0x00000000, LENGTH = 16K
    ram   (rwx) : ORIGIN = 0x1FFFF000, LENGTH =  16K
  }
  </code></pre>
  
  <p><em>app</em></p>
  
  <pre><code>MEMORY { 
    flash (rx)  : ORIGIN = 0x00004000, LENGTH = 112K
    ram   (rwx) : ORIGIN = 0x1FFFF000, LENGTH =  16K
  }
  </code></pre>
  
  <p>Like the makefile, I want to merge these to something like this (using C expressions to clarify)</p>
  
  <pre><code>MEMORY { 
  #ifdef(bootloaderSymbol)
    flash (rx)  : ORIGIN = 0x00000000, LENGTH = 16K
  #else
    flash (rx)  : ORIGIN = 0x00004000, LENGTH = 112K
  #endif
    ram   (rwx) : ORIGIN = 0x1FFFF000, LENGTH =  16K
  }
  </code></pre>