flat assembler
Message board for the users of flat assembler.

Index > Linux > Entry point

Author
Thread Post new topic Reply to topic
Alendar^_^



Joined: 24 Nov 2005
Posts: 2
Alendar^_^ 24 Nov 2005, 23:19
I'm new to FASM, so I wonder why does this occur to me:
It looks like the program doesn't start at the 'start' label, but rather at the 'test_data'
even with 'entry start'. It always results in a "Segmentation fault". I tried moving the
data section after the start label and it worked, but isn't it supposed to work the original way ?

Code:
format ELF executable
entry start

section readable writeable
test_data dd 232,1245,121

section readable executable
start:
 ;...
 ;...
    
Post 24 Nov 2005, 23:19
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 25 Nov 2005, 09:16
This is perhaps because of this: http://board.flatassembler.net/topic.php?t=3689
The last section of executable needs to be writeable.
Post 25 Nov 2005, 09:16
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 25 Nov 2005, 19:29
Tomasz, can you add this issue to the "2.4.4 Executable and Linkable Format" section? I think all the people will think that this is a FASM's bug.

Regards,
Hernán
Post 25 Nov 2005, 19:29
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 25 Nov 2005, 21:28
Well, the ELF format is more than just Linux thing.

I made that thread sticky; maybe we should go on with reporting this to developers, at least start some serious discussion on some kernel groups, whether violating the ELF specification is really a wise thing to do.
Post 25 Nov 2005, 21:28
View user's profile Send private message Visit poster's website Reply with quote
Alendar^_^



Joined: 24 Nov 2005
Posts: 2
Alendar^_^ 26 Nov 2005, 08:29
Thanks for the answer Smile

Regards,
Alendar
Post 26 Nov 2005, 08:29
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.