Programming with FASM – the format ELF executable – part 002 .

By | 17/10/2019

About the Executable and Linkable Format is a common standard file format for executable files, object code, shared libraries, and core dumps, see the Wikipedia webpage.
I used the last version 1.73.16 of flat assembler for Linux to test this format.
Even I used fasm.x64 and uses 64 the files output will in 32 bit.

A simple hello world example in assembly can be written in many ways, but today I will show how can this issue use this format.
The first file named 64_r_w_001.fasm will use the segment readable writeable:

The output will be an executable ELF file:

The next source code from the file named 64_data_w_001.fasm comes with section ‘.data’ writeable:

The result after run it with fasm.x64 will be this:

The gcc tool will give errors for format file and see output of the argument -nostartfiles:

The next step is show how a basic template can be executable using this format:

The result is this:

Test the output files:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.