title: relocation truncated to fit r_386_8 against .bss'
body: <p>When I try to build my source into a 32-bit static executable for Linux with</p>
  <pre><code> nasm -f elf -F dwarf -g loop.asm
   ld -m elf_i386 -o loop loop.o
  </code></pre>
  <p>I get this <code>R_386_8</code> error, any idea what causes it?</p>
  <pre><code>foo.o: in function `loop1':
  foo.asm:(.text+0x12): relocation truncated to fit: R_386_8 against `.bss'
  foo.o: in function `endend':
  foo.asm:(.text+0x2f): relocation truncated to fit: R_386_8 against `.bss'
  </code></pre>
  <p><code>loop.asm</code></p>
  <pre><code>cr equ 13 
  lf equ 10 
  
  section .bss
  numA resb 1
  
  section .text
  
  global _start:
  
  mov [numA],byte 0
  call loop1
  jmp endend
  loop1:
  xor cx,cx
  mov al, $numA
  cmp cx, 0x0A
  jle else 
  inc al
  jmp end
  else:
  dec al
  jmp end
  end:
  mov [$numA], al
  inc cx
  cmp cx,20
  jle loop1
  
  endend:
  mov dl,$numA
  mov ah,2
  int 21h           ; note: DOS system calls won't work in Linux
  </code></pre>
  <p>(Editor's note: this code has multiple bugs; this Q&amp;A is primarily about the one preventing it from linking.  But fixing that won't make a working Linux program.)</p>