title: internal relocation not fixed up
body: <p>i recently started assembler programming for arm cores. My first little demos, only with the .text section, ran without any problems. </p>
  
  <p>As a logical extension i wanted to structure the assembler code into the usual sections: .text, .data, .bss .</p>
  
  <p>So i wrote the following simple program:</p>
  
  <pre><code> .globl _start
  
   .section .text
  
   _start:
       b   main
       b   .
       b   .
       b   .
       b   .
       b   .
       b   .
       b   .  
  
  
   main:
      ldr r0, x
      nop
  
   .section .data
  
   x:  .word  0xf0f0f0f0
  
   .end
  </code></pre>
  
  <p>But </p>
  
  <pre><code>  /opt/arm/bin/arm-as -ggdb -mcpu=arm7tdmi demo.s -o demo.o
  </code></pre>
  
  <p>exits with the error</p>
  
  <pre><code> prog.s: Assembler messages:
   prog.s:17: Error: internal_relocation (type: OFFSET_IMM) not fixed up
   make: *** [prog.o] Error 1
  </code></pre>
  
  <p>I have no clue why the assembler complains about relocation, because i thought that's the task of the linker. I could imagine that i have to tell the assembler that my .data section isn't located at the final memory postion at the assembling stage, but i can't find anything related. </p>
  
  <p>Although i found a way to get the code assembled correctly, by replacing</p>
  
  <pre><code> .section .data
  </code></pre>
  
  <p>by</p>
  
  <pre><code> .org .
  </code></pre>
  
  <p>that is not a satisfying solution. Especially in view of the fact that the gas documentation highlight the sense of this section.</p>
  
  <p>Maybe someone of you experts can help me to gain some wisdom</p>