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: 43
Location: L'viv, Ukraine
uri 15 May 2004, 15:05
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 15 May 2004, 17:26
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: 8351
Location: Kraków, Poland
Tomasz Grysztar 15 May 2004, 17:48
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: 3175
Location: Denmark
f0dder 15 May 2004, 23:04
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 16 May 2004, 09:09
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: 3175
Location: Denmark
f0dder 16 May 2004, 14:41
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: 43
Location: L'viv, Ukraine
uri 17 May 2004, 17:36
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 17 May 2004, 18:39
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: 43
Location: L'viv, Ukraine
uri 20 May 2004, 17:19
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 20 May 2004, 18:15
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: 43
Location: L'viv, Ukraine
uri 07 Jun 2004, 15:43
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: 43
Location: L'viv, Ukraine
uri 04 Sep 2004, 13:15
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 07 Oct 2005, 19:41
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: 8351
Location: Kraków, Poland
Tomasz Grysztar 13 Oct 2005, 17:25
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: 8351
Location: Kraków, Poland
Tomasz Grysztar 13 Oct 2005, 19:46
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 13 Oct 2005, 21:27
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: 8351
Location: Kraków, Poland
Tomasz Grysztar 13 Oct 2005, 22:18
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 14 Oct 2005, 07:12
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: 2139
Location: Estonia
Madis731 18 Oct 2005, 08:16
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: 20299
Location: In your JS exploiting you and your system
revolution 18 Oct 2005, 09:15
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.