我正試圖潛入我的Mac上的一些x86彙編編程,但在生成可執行文件時遇到問題。問題似乎在連接階段。在Mac上使用x86彙編程序的Hello World 0SX
helloWorld.s:
.data
HelloWorldString:
.ascii "Hello World\n"
.text
.globl _start
_start:
# load all the arguments for write()
movl $4, %eax
movl $1, %ebx
movl $HelloWorldString, %ecx
movl $12, %edx
# raises software interrupt to call write()
int $0x80
# call exit()
movl $1, %eax
movl $0, %ebx
int $0x80
彙編程序:
as -o helloWorld.o helloWorld.s
鏈接對象文件:
ld -o helloWorld helloWorld.o
我在這一點上得到的錯誤是:
ld: could not find entry point "start" (perhaps missing crt1.o) for inferred architecture x86_64
任何關於我在做什麼錯誤/失蹤的建議都會非常有幫助。謝謝
工作解決方案,我知道我有點晚了,但你需要_start`改變``到start`。 – sidyll 2011-08-12 21:40:02