title: How to convert a GNU linker Script ld to Scatter File (ARM)
body: <p>I would like to migrate from GCC to the new ARM COMPILER 6.
  But I'm not able to well convert the Gnu liker script (ld) to the equivalent of ARM Scatter file.</p>
  
  <p>The Original Code is as following:</p>
  
  <pre><code>arm-none-eabi-ld -T link.ld test.o shared/bootcode.o shared/vertors.o -o test.elf
  </code></pre>
  
  <p>Where link.ld script is as following</p>
  
  <pre><code>ENTRY(bootcode)
  SECTIONS
  {
      . = 0x00000000;
  
      /* Code starts with vectors, then bootcode, then other code */
      .text :
      {
          *vectors.o(vectors)
          *bootcode.o(boot)
          *(.text) /* remainder of code */
      } =0
  
      .data : { *(.data) }
      .bss  : { *(.bss)  }
  
     /* Notes section
      * This is not used so we discard it. Although not used it needs to be
      * explicitly mentioned in the linker script as some toolchains will place
      * the notes section at adderss 0 if it is not explicitly mentioned*/
      /DISCARD/ : { *(.note*) }
      }
  </code></pre>
  
  <p>I would like to use armlink as a linker : </p>
  
  <pre><code>armlink --cpu=8-A.32 --entry=bootcode test.o shared/bootcode.o shared/vertors.o -o test.elf --scatter=ld.scat
  </code></pre>
  
  <p>But I did not succeed in Creating a valid scatter File. I tried to play with the armlink options (--first, --last, --ro_base, --rw_base) but nothing went as expected (I'm getting successful compilation but the test is not working).</p>
  
  <p>Any Idea on that please?</p>