I'm trying to link a single-module assembly language program assembled with yasm and I get the following error from ld:
Undefined symbols for architecture x86_64:
  "start", referenced from:
     implicit entry/start for main executable
     (maybe you meant: _start)
ld: symbol(s) not found for inferred architecture x86_64
I actually get this error on a semi-regular basis, so I imagine it's a fairly common problem, but somehow no one seems to have a satisfactory answer. Before anyone says this is a duplicate of a previous question, yeah, I know. Just as you can look at the huge text-wall of similarly-titled questions and see that this is a duplicate, so can I.
Compiler Error: Undefined symbols for architecture x86_64
Not applicable to my problem. I'm not coding in C++, and the solution given in that question is idiosyncratic to that language.
undefined symbol for architecture x86_64 in compiling C program
Also doesn't fix my problem, as I'm not trying to link multiple object files together.
Error Undefined symbols for architecture x86_64:
Solution has to do with a specific framework in a high-level language.
Compiler Error: Undefined symbols for architecture x86_64
Solution involves fixing a function prototype. Not applicable here for obvious reasons.
... You get the idea. Every past question I can find is solved by some idiosyncratic method that isn't applicable to my situation.
Please help me with this. I am so tired of getting this error time and time again and not being able to do anything about it because it's so poorly documented. IMHO the world desperately needs a GNU Dev Tools equivalent of the MS-DOS error code reference manual.
Additional information:
Operating system: Mac OS X El Capitain
Source listing:
segment .text
global _start
_start:
    mov     eax,1   ; 1 is the syscall number for exit
    mov     ebx,5   ; 5 is the value to return
    int     0x80    ; execute a system call
Hexdump of the object file, showing that the symbol is indeed _start and not start:
00000000  cf fa ed fe 07 00 00 01  03 00 00 00 01 00 00 00  |................|
00000010  02 00 00 00 b0 00 00 00  00 00 00 00 00 00 00 00  |................|
00000020  19 00 00 00 98 00 00 00  00 00 00 00 00 00 00 00  |................|
00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000040  0c 00 00 00 00 00 00 00  d0 00 00 00 00 00 00 00  |................|
00000050  0c 00 00 00 00 00 00 00  07 00 00 00 07 00 00 00  |................|
00000060  01 00 00 00 00 00 00 00  5f 5f 74 65 78 74 00 00  |........__text..|
00000070  00 00 00 00 00 00 00 00  5f 5f 54 45 58 54 00 00  |........__TEXT..|
00000080  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000090  0c 00 00 00 00 00 00 00  d0 00 00 00 00 00 00 00  |................|
000000a0  00 00 00 00 00 00 00 00  00 00 00 80 00 00 00 00  |................|
000000b0  00 00 00 00 00 00 00 00  02 00 00 00 18 00 00 00  |................|
000000c0  dc 00 00 00 01 00 00 00  ec 00 00 00 08 00 00 00  |................|
000000d0  b8 01 00 00 00 bb 05 00  00 00 cd 80 01 00 00 00  |................|
000000e0  0f 01 00 00 00 00 00 00  00 00 00 00 00 5f 73 74  |............._st|
000000f0  61 72 74 00                                       |art.|
000000f4