title: Can't link object file using ld - Mac OS X
body: <pre><code>/*********
  exit.asm
  */
  
  [SECTION .text]
  
  global _start
  
  
  _start:
  xor eax, eax
  xor ebx, ebx
  mov al, 1
  int 0x80
  
  //****************************
  </code></pre>
  
  <p>First I used nasm -f elf exit.asm to generate the object file.</p>
  
  <p>then I ran the following "ld" command on my Mac OS X 10.7, it has the these outputs and warning, I tried to run it on my 32 bit linux machine, everything went through just fine,
  Could you please explain why would not the linker work on my Mac? </p>
  
  <p>Thank you!</p>
  
  <pre><code>Alfred says: ld -o exiter exit.o
  ld: warning: -arch not specified
  ld: warning: -macosx_version_min not specified, assuming 10.7
  ld: warning: ignoring file exit.o, file was built for unsupported file format ( 0x7f 0x45      0x4c 0x46 0x 1 0x 1 0x 1 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 ) which is not the   architecture being linked (x86_64): exit.o
  Undefined symbols for architecture x86_64:
    "start", referenced from:
      implicit entry/start for main executable
  ld: symbol(s) not found for inferred architecture x86_64
  </code></pre>
  
  <p>after I specify my arch and version, I got:</p>
  
  <pre><code>Alfred says: ld -arch x86_64 -macosx_version_min 10.7 -o exiter exit.o
  ld: warning: ignoring file exit.o, file was built for unsupported file format ( 0x7f 0x45     0x4c 0x46 0x 1 0x 1 0x 1 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 ) which is not the   architecture being linked (x86_64): exit.o
   Undefined symbols for architecture x86_64:
   "start", referenced from:
      implicit entry/start for main executable
   ld: symbol(s) not found for architecture x86_64
  </code></pre>