How to make an executable file from assembly language? (in emacs)

Can someone tell me how to make an executable file in assembler? my environment is Ubuntu + Emacs + GCC for educational purpose I wrote C code (hello.c) and converted it to assembly (hello.s)

and I want to make an executable from a recorded build file.

I tried

Mx compile gcc hello.c -S 

make assembly from C code

and

 Mx compile as hello.s 

make executable file

but there is only a.out file and it cannot execute

so i tried

 as hello.s -o aaa 

but the file "aaa" is not executable

+4
source share
1 answer

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

+3
source

Source: https://habr.com/ru/post/1343717/


All Articles