How do you build a C program that includes the entry point on Mac OS X?
问题 How do you build a C program that includes the entry point on Mac OS X? I want to build: start() { /* exit system call */ asm("movl $1,%eax;" "xorl %ebx,%ebx;" "int $0x80" ); } but when I run: gcc -nostdlib min.c I always get: ld: could not find entry point "start" (perhaps missing crt1.o) collect2: ld returned 1 exit status The one other attempt I made just to see what it was doing was run: gcc -nostdlib -c min.c && otool -tV min.o And the output was: (__TEXT,__text) section _start: