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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With