title: Assembly: relocation truncated to fit r_x86_64_16 against '.data'
body: <p>I have problems with my assembly code. This code for print text from file.</p>
  
  <pre><code>%define B_LENGTH 80
  %define STDOUT 0x0001
  SECTION .text
  global _start
  _start:
  mov bp,STDOUT
  mov ax, 0x3D00
  mov dx,file_name
  int 0x21
  jc error
  mov bx,ax
  read_next:
  mov ah,0x3F
  mov dx,buffer
  mov cx, B_LENGTH
  int 0x21
  jc error
  xor ax,ax
  jz end_reading
  mov cx, ax
  mov ah,0x40
  xchg bp,bx
  int 0x21
  xchg bp,bx
  jmp read_next
  end_reading:
  mov ah, 0x3E
  int 0x21
  mov al,0
  endprog:
  mov ah,4Ch
  int 0x21
  error:
  mov al,1
  jmp short endprog
  SECTION .data
  file_name db 'text.txt'
  buffer times B_LENGTH db 0
  </code></pre>
  
  <p>For compile I use </p>
  
  <pre><code>nasm -felf64 task.asm -o task.o
  ld -o task task.o
  </code></pre>
  
  <p>There what I see after compile</p>
  
  <pre><code>task.o: In function '_start':
  task.asm: (.text+0xa): relocation truncated to fit: R_X86_64_16 against '.data'
  task.o: In function 'read_next':
  task.asm: (.text+0x17): relocation truncated to fit: R_X86_64_16 against '.data'
  </code></pre>
  
  <p>Can you help me to understand what the reason of this mistake?</p>