flat assembler
Message board for the users of flat assembler.

Index > Main > Too long symbols

Author
Thread Post new topic Reply to topic
hg



Joined: 24 Jan 2006
Posts: 10
hg 25 Jan 2006, 13:36
It seems that Fasm has a limitation of 256 chars for symbol names.
This is a big limitation though.
It's common that Microsoft compiler generates names which are longer then this and if you plan to work against existing compiled code there are lots of tricks you have to do to overcome this.

Here is an example a symbol of length 533 chars:

?_Isnil@?$_Tree@V?$_Tset_traits@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@$0A@@std@@@std@@KAAADPAU_Node@?$_Tree_nod@V?$_Tset_traits@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@$0A@@std@@@2@@Z

Is it possible that it can be extended to atleast 1024 for next version?
Post 25 Jan 2006, 13:36
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 25 Jan 2006, 13:46
why don't you import it under shorter name?

Or what are you going to do with such long symbols?
Post 25 Jan 2006, 13:46
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 25 Jan 2006, 13:49
This is about the only one limitation in fasm that is so deeply buried in internals that would require massive rewrite to extend it.

However I don't think this is really a problem - when you need to access the external symbols of longer names, or make some symbols public and give them longer names, you can use the extended EXTRN/PUBLIC syntaxes, like:
Code:
extrn '?_Isnil@?$_Tree@V?$_Tset_traits@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@$0A@@std@@@std@@KAAADPAU_Node@?$_Tree_nod@V?$_Tset_traits@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@$0A@@std@@@2@@Z' as SomeMoreFriendlyName    

(scroll right to read the ending of the line Wink )
and access that symbol inside the assembly source under SomeMoreFriendlyName.
More information on EXTRN/PUBLIC in section 2.4.3 of manual.
Post 25 Jan 2006, 13:49
View user's profile Send private message Visit poster's website Reply with quote
hg



Joined: 24 Jan 2006
Posts: 10
hg 25 Jan 2006, 13:54
vid wrote:
why don't you import it under shorter name?

Or what are you going to do with such long symbols?


I'm trying to build a re-assembler tool. The idea is to process exising ms coff files to generate a asm file. This asm file must be compilable and link against existing object files produced by VC++ compiler.
I was targeting Masm at first which has the same symbol size limitation but due to lots of problems with masm I am retrying to retarget my output code for fasm instead.

In short I'm trying to build a tool which will generate the same type of code as VC++ compiler.

I'm both importing and exporting symbols. I am not sure if it will work with aliases since it's still something that has to interface the real world.

-- Henrik
Post 25 Jan 2006, 13:54
View user's profile Send private message Reply with quote
hg



Joined: 24 Jan 2006
Posts: 10
hg 25 Jan 2006, 13:56
Thanks for the quick reply. I'll give it a try and see how far I get.

-- Henrik
Post 25 Jan 2006, 13:56
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 25 Jan 2006, 14:20
Tomasz Grysztar wrote:
This is about the only one limitation in fasm that is so deeply buried in internals that would require massive rewrite to extend it.

You use strings with byte-size (semi-pascal style)?
Post 25 Jan 2006, 14:20
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 25 Jan 2006, 14:42
It's the limitation in preprocessor's source encoding scheme - it's already documented in guide to fasm's internals (it still lies here somewhere).

[EDIT]"Somewhere" means here: http://board.flatassembler.net/topic.php?t=3883 [/EDIT]
Post 25 Jan 2006, 14:42
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.