flat assembler
Message board for the users of flat assembler.

Index > Main > /DEFAULTLIB

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
uri



Joined: 09 Apr 2004
Posts: 44
Location: L'viv, Ukraine
uri
Hi, All!

How can i send fasm to insert in obj (format COFF) command for linker to use specific lib? Same as /DEFAULTLIB:libfile command to microsoft link?

Obj format supports it, but do support fasm?

thanks...
Post 15 May 2004, 15:05
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard
no. To use any library in COFF format you have to use some external linker, like GoLink or ALink.
Post 15 May 2004, 17:26
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7756
Location: Kraków, Poland
Tomasz Grysztar
This could be done by making the '.drectve' section in COFF object, but fasm currently doesnt' have any setting that would allow you to set IMAGE_SCN_LNK_INFO flag for such section, which is needed for it to be recognized by linker. If you suggest any good name for such flag setting (something like the already used "executable" or "discardable" flags), it can be implemented quickly.

When I was developing the first COFF-able version of fasm (it was 1.39, if I recall correctly) I was trying it with some temporarily chosen flag name and I was successful - all parameters passed inside the '.drectve' section were used by linker and section was not included in executable.
Post 15 May 2004, 17:48
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
what about calling it simply 'linkinfo'? or perhaps 'linkparms'?
Post 15 May 2004, 23:04
View user's profile Send private message Visit poster's website Reply with quote
ShortCoder



Joined: 07 May 2004
Posts: 105
ShortCoder
What about linklib or even inslib or libinsert?
Post 16 May 2004, 09:09
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
you can use the linker comment for more than just inserting libraries, though - like specifying /FILEALIGN or whatever.
Post 16 May 2004, 14:41
View user's profile Send private message Visit poster's website Reply with quote
uri



Joined: 09 Apr 2004
Posts: 44
Location: L'viv, Ukraine
uri
Privalov
If you suggest any good name for such flag setting

virtual

Because this section not include for executable module.
?
Post 17 May 2004, 17:36
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo
Better '.virtual' ?
Post 17 May 2004, 18:39
View user's profile Send private message Yahoo Messenger Reply with quote
uri



Joined: 09 Apr 2004
Posts: 44
Location: L'viv, Ukraine
uri
2 Privalov
If you suggest any good name for such flag setting (something like the already used "executable" or "discardable" flags), it can be implemented quickly.

Please, this feature is very important. Because when you have more than 70 different lib's it's very hard ot write all in command line for link instead write only 'include filex.inc'...
Post 20 May 2004, 17:19
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
uri is right. Don't forget about DOS command line size limitation.
Post 20 May 2004, 18:15
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
uri



Joined: 09 Apr 2004
Posts: 44
Location: L'viv, Ukraine
uri
2 Privalov: and what you think about this thread?
Post 07 Jun 2004, 15:43
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
uri



Joined: 09 Apr 2004
Posts: 44
Location: L'viv, Ukraine
uri
Heh. For all, who want to use options for ms link (like /DEFAULTLIB) from asm code (with format MS COFF):

First: we must patch fasm sources. We must open FORMATS.INC and add to formatter_symbols (at the end of file) table this lines:
Code:
 db 7,'drectve',19h,9
 db 6,'hidden',19h,11
    

Attension: you must preserve alphabetically order in this table !!!

You must get like this:
Code:
 db 11,'discardable',19h,25
 db 3,'dll',1Bh,80h
 db 7,'drectve',19h,9
 db 3,'elf',18h,5
 db 10,'executable',19h,29
 db 6,'export',1Ah,0
 db 6,'fixups',1Ah,5
 db 3,'gui',1Bh,2
 db 6,'hidden',19h,11
 db 6,'import',1Ah,1
 db 2,'ms',18h,41h
    


Ok, now we must go to VERSION.INC and change version number to 1.55b (or other version, if you wish).

And now we must recompile fasm: fasm fasm.asm fasm.exe (or fasmw.asm if you want to use fasmw).

Thats all.

To have new abilities we must write in our asm code lines like this:
Code:
section '.drectve' drectve hidden
 db '-defaultlib:kernel32.lib -defaultlib:user32.lib -defaultlib:gdi32.lib '
    


and when you will link this file (obj file, what will get from this asm) ms link will add to command line text from .drectve section.

One moment. We add new option hidden. This option say to link do not add section to executable and you can use this sections to add comments (or copyrights) to you obj file, like this:
Code:
section 'comment' hidden
db 'This file was created by Uri. All rights reserved...',0

section '.text' code readable executable
    

You will have this text in obj, but do not have in exe (or dll, or ...).

Thank you Privalov. Fasm the best !!!
Post 04 Sep 2004, 13:15
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
FloHimself



Joined: 07 Oct 2005
Posts: 1
FloHimself
will this feature become part of fasm someday?

_________________
Talent does what it can, genius what it must. I do what I get paid to do.
Post 07 Oct 2005, 19:41
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7756
Location: Kraków, Poland
Tomasz Grysztar
I prefer the "linkinfo" name for the IMAGE_SCN_LNK_INFO flag. Still haven't decided for the IMAGE_SCN_LNK_REMOVE, but "hidden" seems to be a good choice.
Post 13 Oct 2005, 17:25
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7756
Location: Kraków, Poland
Tomasz Grysztar
The "linkinfo" and "hidden" are added as a "hidden" updated to the 1.64 Wink
Post 13 Oct 2005, 19:46
View user's profile Send private message Visit poster's website Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard
Seems that you wish to keep version number 1.64 as long as it is possible Wink
Post 13 Oct 2005, 21:27
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7756
Location: Kraków, Poland
Tomasz Grysztar
The 1.65.x development line is supposed to focus on the different things in my plans and I don't want to start it prematurely.
Post 13 Oct 2005, 22:18
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
decard: it's a good version number Smile
Post 14 Oct 2005, 07:12
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2140
Location: Estonia
Madis731
Off-topic: Version 1 means it is mature and 64 is the ability to compile a 64-bit binary file.
Post 18 Oct 2005, 08:16
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17475
Location: In your JS exploiting you and your system
revolution
Quote:
ability to compile a 64-bit binary file.
Only a 64 bit (8 byte) file! What if I need a file bigger than that, say 9 bytes in length? What if I need a file smaller than that, say 7 bytes in length? Smile
Post 18 Oct 2005, 09:15
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:  
Goto page 1, 2  Next

< 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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.