开发者

how to make executable from assembly language?(in emacs)

Could somebody tell me how to make executable from assembly language? my environment is Ubuntu + Emacs + GCC for learning purpose, I wrote some C code(hello.c) and convert it to assembly (hello.s)

and I want to make an executable file from an assembly written file.开发者_如何学编程

I tried

M-x compile

gcc hello.c -S

to make assembly from C code

and

M-x compile

as hello.s 

to make executable file

but there's only a.out file and it isn't able to execute

so I tried

as hello.s -o aaa

but file "aaa" is not executable


The output of as is an object file. To make it executable you need to link it with ld but you will also need to link in any objects it depends on, which if the source was generated from gcc, will at least include libc, as well as probably some other object files.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜