title: Controlling File Offset in linking
body: <p>I have some assembler for the Microblaze that I want to load at address 0x00000000 (ie to ensure it is executed on a reset).</p>
  
  <p>I have a linker script that should do this (I think):</p>
  
  <pre><code>SECTIONS
  {
      ENTRY(_start)
      . = 0x0000;
      .vectors.reset : { *(.vectors.reset) }
      . = 0x0008;
      .vectors.sw_exception : { *(.vectors.sw_exception) }
      . = 0x0010;
      .vectors.interrupt : { *(.vectors.interrupt) }
      . = 0x0018;
      .vectors.hw_exception : { *(.vectors.hw_exception) }
      . = 0x100;
      .text : { *(.text) }
      .data : { *(.data) }
      .bss : { *(.bss) }
  }
  </code></pre>
  
  <p>But when the code is compiled it seems to be offset by 0x1000:</p>
  
  <pre><code>objdump -h startup.MICROBLAZE.elf 
  
  startup.MICROBLAZE.elf:     file format elf32-big
  
  Sections:
  Idx Name          Size      VMA       LMA       File off  Algn  
    0 .vectors.reset 00000008  00000000  00000000  00001000  2**2
                     CONTENTS, ALLOC, LOAD, READONLY, CODE
    1 .vectors.sw_exception 00000008  00000008  00000008  00001008  2**2
                    CONTENTS, ALLOC, LOAD, READONLY, CODE
    2 .vectors.interrupt 00000008  00000010  00000010  00001010  2**2
                    CONTENTS, ALLOC, LOAD, READONLY, CODE
    3 .vectors.hw_exception 00000008  00000018  00000018  00001018  2**2
                    CONTENTS, ALLOC, LOAD, READONLY, CODE
    4 .text         00000020  00000100  00000100  00001100  2**4
                    CONTENTS, ALLOC, LOAD, READONLY, CODE
  </code></pre>
  
  <p>Where does that offset come from and how can I supress/control it?</p>
  
  <p>Edit: It seems the 0x1000 offset is the physical offset of the code section in the compiled file/object - is that correct?</p>