osx - How does one build an x64 assembly program in OS X? -


I'm trying to make Hello World in my x64 assembly on Leopard MacBook Pro. It's ok, but I get this error when I try to link it: ld: symbol dyld_stub_binding_helper is not defined (usually in crt1.o/dylib1.o/bundle1.o) inferred architecture x86_64

I have loaded it with ld -o hello64 ​​hello64.o -lc

My Ensemble is Yasm.

Edit: As far as I can tell, unlike 32-bit code, you have to supply the stub assistant yourself, and because I do not know how to get 64-bit stub helper Works as I would like, Bastian said and linked to GCC because it includes its own stub assistant.

Doh! If my assembly entry entry _main instead of _start

-Text "itemprop =" text ">

Just handle the linker invitation to the GCC. Something like this:

  GCC Hello 64.O-o Hello 64  < / Pre> 

Your assembly code probably needs to define a main sign, or perhaps start .

[edit]

The reason is that I am suggesting that various platforms Linking the binker in different ways if you see that GCC passes through GCC with GCC to the - Verbose command line option, then you will know that it is complex and implementation-dependent .


Comments