flat assembler
Message board for the users of flat assembler.

Index > Unix > fasm port with libc

Author
Thread Post new topic Reply to topic
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 08 Jun 2004, 17:43
This is a new port of fasm I've made using the ELF object format and the standard C library. I have tested it on Linux, it would be nice is someone tested it under some other OS-es that support ELF format (like BSD or BeOS). The package provided here contains the sources and the "fasm.o" ELF object file. With the GNU tools the "gcc fasm.o -o fasm" command should make the final executable for you, I don't know about other C compilers, you are welcome to check it out.

(Edit: obsolete attachment has been removed)


Last edited by Tomasz Grysztar on 10 Oct 2005, 21:21; edited 3 times in total
Post 08 Jun 2004, 17:43
View user's profile Send private message Visit poster's website Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica 09 Jun 2004, 12:47
Works fine on Fedora Core 1 (kernel 2.6.4, gcc 3.3.2)
Also, g++ [EDIT](C++ compiler)[/EDIT] works too, thought the elf is a few (24) bytes larger compiled with g++ than gcc.
Post 09 Jun 2004, 12:47
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 09 Jun 2004, 14:37
probably because the GNU tools like to insert all sorts of strings in your executables... try running 'strings' on gcc and g++ compiled versions, you should see some differences I think.
Post 09 Jun 2004, 14:37
View user's profile Send private message Visit poster's website Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica 10 Jun 2004, 13:05
before strip (`man 1 strip`):
71752 fasm
71776 fasm_g++

after stripping:
69620 fasm
69644 fasm_g++

self compiled fasm:
58938 fasm

it seems it's not just the text that differs (also binary), but well, doesn't really matter. It uses libc, and it works - regardless of wheter GNU tools add a little extra or not Smile
Post 10 Jun 2004, 13:05
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 10 Jun 2004, 13:59
ah, libc is linked in - then it's probably C++ init code (c0/crt0) that is a bit larger than the C init code. Just a guess anyway. Nothing much to worry about anyway, I wouldn't worry about 10k Smile
Post 10 Jun 2004, 13:59
View user's profile Send private message Visit poster's website Reply with quote
crc



Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc 11 Jun 2004, 13:15
It almost works under BeOS 5. It will assemble sample programs (including itself Very Happy ) but segfaults on exit. The segfault is a minor irritant, and I'll see if I can fix it this weekend. Overall, I'm thrilled with the libc support. I'll also try it under Syllable next week (waiting for the ISO to finish downloading...).

_________________
Charles Childers, Programmer
Post 11 Jun 2004, 13:15
View user's profile Send private message Visit poster's website Reply with quote
NULLPointer



Joined: 28 May 2004
Posts: 11
NULLPointer 13 Jun 2004, 03:19
I probed it on BeOS 5 PE and it crashes at the end, i want to know the way to find where is the error because its imposible to debug it under BDB. is there an easy way?

Thanks.
Post 13 Jun 2004, 03:19
View user's profile Send private message MSN Messenger Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 13 Jun 2004, 12:06
You could always do the tedious thing - insert a lot of print statements, and see when it dies... aren't there any nice debuggers for BeOS?
Post 13 Jun 2004, 12:06
View user's profile Send private message Visit poster's website Reply with quote
crc



Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc 13 Jun 2004, 12:07
Ok, I managed to make it work perfectly under BeOS 5 PE (and Pro). Under BeOS (and similar OSes), the exit function needs to be called to handle some cleanup. I've attached a new version (full code + a BeOS binary) for you all to test.

(Edit: obsolete attachment has been removed)

_________________
Charles Childers, Programmer
Post 13 Jun 2004, 12:07
View user's profile Send private message Visit poster's website Reply with quote
gorshing



Joined: 27 Jul 2003
Posts: 72
Location: Okla, US
gorshing 14 Jun 2004, 01:55
Privalov wrote:
This is a new port of fasm I've made using the ELF object format


On my machine ...
Code:
gorshing [/home/gorshing/devl/asm]$ file fasm_libc
fasm_libc: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.4.1, dynamically linked (uses shared libs), not stripped
gorshing [/home/gorshing/devl/asm]$ file ~/fasm/fasm
/home/gorshing/fasm/fasm: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
gorshing [/home/gorshing/devl/asm]$    


Weren't you always using the ELF format? Or am I missing something?

_________________
gorshing
Post 14 Jun 2004, 01:55
View user's profile Send private message Visit poster's website Reply with quote
crc



Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc 14 Jun 2004, 02:02
Quote:
Weren't you always using the ELF format? Or am I missing something?


It's a port using ELF and the standard C library. The ELF support is not new, but the LIBC backing is new.

_________________
Charles Childers, Programmer
Post 14 Jun 2004, 02:02
View user's profile Send private message Visit poster's website Reply with quote
gorshing



Joined: 27 Jul 2003
Posts: 72
Location: Okla, US
gorshing 14 Jun 2004, 03:30
I understand that, but the way Privalov stated that, it seemed to me that he implied that ELF was new also.

_________________
gorshing
Post 14 Jun 2004, 03:30
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 14 Aug 2004, 20:10
I have updated the attachment in first post - now it contains the libc interface adapted to use with fasm 1.54
Post 14 Aug 2004, 20:10
View user's profile Send private message Visit poster's website Reply with quote
Tommy



Joined: 17 Jun 2003
Posts: 489
Location: Norway
Tommy 18 Sep 2004, 15:46
Will you continue this distribution Privalov?
Post 18 Sep 2004, 15:46
View user's profile Send private message Visit poster's website Reply with quote
stanks



Joined: 01 Dec 2003
Posts: 36
Location: Croatia
stanks 26 Dec 2004, 08:46
Hi crc

This version (1.52) works ok under BeOS. No segmentation fault.

stanks
Post 26 Dec 2004, 08:46
View user's profile Send private message ICQ Number Reply with quote
crc



Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc 26 Dec 2004, 13:26
Ok, I'll see what's been changed then...
Post 26 Dec 2004, 13:26
View user's profile Send private message Visit poster's website 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.