title: linker outputs 'relocation truncated to fit: R_X86_64_32' when trying to link yasm assembled program
body: <p>I have a simple asm file:</p>
  
  <pre><code>$ cat my.asm
      segment .text
      global _start
  
  _start:
          mov eax,1
          mov ebx,5
          int 0x80
  </code></pre>
  
  <p>Assembling with yasm works ok:</p>
  
  <pre><code>$ yasm -f elf64 -g dwarf2  -l my.lst my.asm
  </code></pre>
  
  <p>Linking returns some output:</p>
  
  <pre><code>$ ld -o my my.o
  my.o:(.debug_aranges+0x6): relocation truncated to fit: R_X86_64_32 against `.debug_info'
  my.o:(.debug_info+0x6): relocation truncated to fit: R_X86_64_32 against `.debug_abbrev'
  my.o:(.debug_info+0xc): relocation truncated to fit: R_X86_64_32 against `.debug_line'
  </code></pre>
  
  <p>However, no executable is created. </p>
  
  <p>My environment is:</p>
  
  <pre><code>$ yasm --version
  yasm 1.2.0
  
  $ ld --version
  GNU ld (GNU Binutils) 2.23.52.20130604
  
  $ uname -a
  CYGWIN_NT-6.1 MYHOST 1.7.25(0.270/5/3) 2013-08-31 20:37 x86_64 Cygwin
  </code></pre>
  
  <p>The code snippet and assembling/linking steps came from the book: <a href="http://www.amazon.co.uk/Introduction-Intel-Assembly-Language-Programming/dp/1466470038" rel="nofollow">Introduction to 64bit Intel Assembly Language Programming</a></p>
  
  <p>Any pointers as to why this is not working will be appreciated.</p>