flat assembler
Message board for the users of flat assembler.

Index > Main > Section Merging

Author
Thread Post new topic Reply to topic
jInuQ



Joined: 26 Jun 2003
Posts: 48
Location: USA - NV
jInuQ
Hello,
Was wondering if there was anyway to get fasm to merge duplicate sections? I was thinking for use with several file that use the Win32 import section. Can duplicate import records be prevented?

_________________
jInuQ

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away."
- Antoine de Saint Exupery
Post 27 Jan 2004, 00:25
View user's profile Send private message Visit poster's website AIM Address Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
Hm, why you actually need to have import section in every source file. Isn't it more easy to have only one import section importing everything from FASM import include files and to leave FASM to determine what to include in import section of your program. Note, that standard import macroses of FASM will not import not used functions.
I use following code in Fresh and now I am happy with it because I don't need to enumerate every used function in import section and to cleanup after some editing of the program. It will cost you only about 1 second compilatin time.
Code:
section '.idata' import data readable writeable

  library kernel32,'KERNEL32.DLL',\
          user32,'USER32.DLL',    \
          gdi32,'gdi32.dll',      \
          comctl32,'comctl32.dll',\
          comdlg32,'comdlg32.dll',\
          shell32, 'shell32.dll', \
          ole32,   'ole32.dll'

  include '%finc%\win32\apia\kernel32.inc'
  include '%finc%\win32\apia\user32.inc'
  include '%finc%\win32\apia\gdi32.inc'
  include '%finc%\win32\apia\ComCtl32.inc'
  include '%finc%\win32\apia\ComDlg32.inc'
  include '%finc%\win32\apia\Shell32.inc'
  include '%finc%\win32\apia\ole32.inc'
    
Post 04 Feb 2004, 19:06
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Vortex



Joined: 17 Jun 2003
Posts: 318
Vortex
jInuQ,

Is it a problem concerning linkers?

_________________
Code it... That's all...
Post 04 Feb 2004, 19:54
View user's profile Send private message Visit poster's website Reply with quote
jInuQ



Joined: 26 Jun 2003
Posts: 48
Location: USA - NV
jInuQ
Well at first it was for .data sections so that I don't have to have a ton of data sections.

_________________
jInuQ

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away."
- Antoine de Saint Exupery
Post 04 Feb 2004, 23:23
View user's profile Send private message Visit poster's website AIM Address Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
jInuQ wrote:
Well at first it was for .data sections so that I don't have to have a ton of data sections.


Well, for data sections there is completly different solution. You need "globals.inc" library from Fresh project. Simply read Decard's file freshguide.chm from Fresh package (It is included in the latest work version) or from here: http://board.flatassembler.net/topic.php?t=883
There are descriptions and example of use for this macro library.

Regards.
Post 05 Feb 2004, 01:41
View user's profile Send private message Visit poster's website ICQ Number 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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.