I have some problem here with adding a section using FASM Syntax. I have checked on others websites and I am sure this is the right syntax. I must be missing something :
format elf executable 3
entry start
section '.text' readable executable
start:
mov ebx, 0
mov eax, 1
int 0x80
and FASM is giving me :
flat assembler version 1.70.03 (16384 kilobytes memory) exit.asm[4]: section '.text' readable executable error: illegal instruction.
Btw I can't also create a named segment like:
segment .data
but I can do :
segment readable executable
I can't find an explanation for this.
It seems that the FASM documentation for ELFs aren't up to date. You should go to the FASM forums and report and/or ask about it.
I got this to compile in
1.70.03
, adapted from theelfexe
example: