flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > bug

Author
Thread Post new topic Reply to topic
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio 28 Mar 2006, 15:43
In the string table of a elf file generated with Fasm 1.64 it appears:
' .rel.text ' ,i think it should be a zero after '.rel'
Post 28 Mar 2006, 15:43
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8354
Location: Kraków, Poland
Tomasz Grysztar 28 Mar 2006, 17:40
For each section like .text or .data the section containing relocations for it is named .rel.text or .rel.data (see ELF specs). By pointing into right offsets into string table the .rel.text and .text section names are obtained from the same data - this is a nice space saving.
Post 28 Mar 2006, 17:40
View user's profile Send private message Visit poster's website Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio 29 Mar 2006, 07:09
Ok, i didn´t read enought.
Post 29 Mar 2006, 07:09
View user's profile Send private message Visit poster's website Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio 02 Apr 2006, 09:31
there is another strange thing on the elf file, in the symbol table,the symbol 'main' has 'stt_notype=0' that means undefined or constant value
but since the value of 'main' is related to where the code section is loaded
i think it should be 'stt_section=3' type.

and another question, why the clib version of fasm uses functions like:
putchar,fread,lseek+ftell
instead of the more simple and efficient:
printf,read,filesize.
Post 02 Apr 2006, 09:31
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8354
Location: Kraków, Poland
Tomasz Grysztar 02 Apr 2006, 10:25
Type STT_SECTION means the symbol representing whole section object, not the label inside the section. Anyway latest fasm versions changed to put STT_FUNC type for the simple labels.
See the guide about porting fasm for explanation why "lseek", "ftell", etc. are needed.
Post 02 Apr 2006, 10:25
View user's profile Send private message Visit poster's website Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio 02 Apr 2006, 15:31
Finally i get out that constant symbols use a especial section index
so in general the symbol type can be ignored.
I don´t found the explanation in fasm internals about the use of
'fwrite' instead of 'write' or 'putchar' instead of 'printf',thats not a problem at all and i know that i can change the sources myself, but first i want to try a generic solution that could be used also for porting other software.
And finally, how the assembly to ram project is going?
Post 02 Apr 2006, 15:31
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8354
Location: Kraków, Poland
Tomasz Grysztar 02 Apr 2006, 16:01
Why write would be better than fwrite? putchar is used to implement all the functions from the display_* family - why import more functions when one is enough? And printf wouldn't work for display_block implementation, as the string is not zero-ended in that case.
Post 02 Apr 2006, 16:01
View user's profile Send private message Visit poster's website Reply with quote
okasvi



Joined: 18 Aug 2005
Posts: 382
Location: Finland
okasvi 03 Apr 2006, 10:33
Octavio wrote:
And finally, how the assembly to ram project is going?


is that the code generation library project or some project i havent heard about?

_________________
When We Ride On Our Enemies
support reverse smileys |:
Post 03 Apr 2006, 10:33
View user's profile Send private message MSN Messenger Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio 03 Apr 2006, 15:52
okasvi wrote:
Octavio wrote:
And finally, how the assembly to ram project is going?


is that the code generation library project or some project i havent heard about?

i'm not sure if this is the same, what i want to do is to load directly the source code ,without using executables, i already do this with my assembler and it shoudn´t be much complicated to do the same with fasm.
Post 03 Apr 2006, 15:52
View user's profile Send private message Visit poster's website Reply with quote
TDCNL



Joined: 25 Jan 2006
Posts: 56
TDCNL 25 Apr 2006, 00:13
Octavio wrote:
okasvi wrote:
Octavio wrote:
And finally, how the assembly to ram project is going?


is that the code generation library project or some project i havent heard about?

i'm not sure if this is the same, what i want to do is to load directly the source code ,without using executables, i already do this with my assembler and it shoudn´t be much complicated to do the same with fasm.


Why would you like to do that? Wink

_________________
:: The Dutch Cracker ::
Post 25 Apr 2006, 00:13
View user's profile Send private message Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio 25 Apr 2006, 12:44
TDCNL wrote:

Why would you like to do that? Wink

If the source is also the executable:
1: less files and disk space is needed
2: less programing tools are needed, no linker, no exe loader etc...
3: source is more portable than executables.
4: you can always take a look at the program with a txt editor to see
if it includes something like 'include virus.asm ' Smile
5: it was easy to do the same with Fasm.
6: Why would you like to use exe files?
Post 25 Apr 2006, 12:44
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 25 Apr 2006, 13:04
Quote:
Why would you like to use exe files?

1: less files and disk space is needed
2: less tools are needed, no linker, no compiler/interpereter etc...
3: source is less portable than executables and thus more efficient for one particular implementation.
4: you cannot take a look at the program with a txt editor to see
if it includes something like 'include virus.asm '
5: it is easy to do the same with Fasm.

:DDD

don't take me too serious, i like the idea
Post 25 Apr 2006, 13:04
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2465
Location: Bucharest, Romania
Borsuc 25 Apr 2006, 13:05
Octavio wrote:
1: less files and disk space is needed
Not necessary. You can have source in a .7zip, or don't have it at all, if you're not interested in it.
Octavio wrote:
2: less programing tools are needed, no linker, no exe loader etc...
Yes, though you don't necessarily need a linker.. but you need Fasm in this case (some guys probably only want the .exe and not the source)[/quote]
Octavio wrote:
3: source is more portable than executables.
What do you mean? Maybe there are tools that convert exe to another. and besides, is it THAT hard to recompile your program once again for a new version, whatever?[/quote]
Octavio wrote:
4: you can always take a look at the program with a txt editor to see if it includes something like 'include virus.asm ' Smile
Laughing
Octavio wrote:
5: it was easy to do the same with Fasm.
Perhaps Very Happy
Octavio wrote:
6: Why would you like to use exe files?
.exe files are much faster, they do not need assembling. They are smaller, etc. They are the native language of the processor. Just imagine yourself trying to speak a language you find hard to understand -- of course it will SLOW you down to understand someone in that language. Same with processor.

Personally, I hate text files that get executed at run-time, or something like that. For example, some years ago, when I didn't know asm at all, I compiled some scripts for Starcraft. Then, a friend asked me if I could write some AI for Warcraft III for him to play with (since he wasn't good at it). And I tried to help him with it, but I realized Warcraft 3 uses 'text' scripts (not compiled) and I hate them. It wasn't that I couldn't learn them -- in fact, I finally managed to get the AI to my friend and he was pleased, but I felt strange to know that these 'scripts' get inside the game archive and whatever, and are compiled at run-time. I just don't like it. Don't get me wrong Smile

Most people find "xml" or other text formats magical.. I simply do not understand why? On the contrary, they are even less magical. I especially hate them when they affect the run-time of a program or whatever (except customization things like .ini, of course Wink)
Post 25 Apr 2006, 13:05
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.