flat assembler
Message board for the users of flat assembler.

Index > Main > Import section problem

Author
Thread Post new topic Reply to topic
omega_red



Joined: 13 Mar 2004
Posts: 19
Location: Poland
omega_red
I have following source:
Code:
format PE

include '%fasminc%\win32a.inc'
;------------------------------------------------

section 'all' code data readable writable executable

    ret

;------------------------------------------------
data import

library kernel,'kernel32.dll'

import kernel,\
  ExitProcess,'ExitProcess'

end data    


It compiles, but FASM (1.55) doesn't generate any imports in EXE. Why?

_________________
Vulnerant omnes, ultima necat
Post 07 Sep 2004, 15:31
View user's profile Send private message Visit poster's website Reply with quote
omega_red



Joined: 13 Mar 2004
Posts: 19
Location: Poland
omega_red
OK, it's because the imported function was unreferenced. But how to force FASM to generate such unreferenced imports?

_________________
Vulnerant omnes, ultima necat
Post 07 Sep 2004, 16:05
View user's profile Send private message Visit poster's website Reply with quote
crc



Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc
Shouldn't you have the imports in an idata section? (Maybe you already set this up with macros, I don't know...)

Code:
section '.idata' import data readable writeable    
Post 07 Sep 2004, 16:23
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7718
Location: Kraków, Poland
Tomasz Grysztar
The symbol does not necessarily need to be referenced in code to make assembler think it is "used", the other way is to do some definition like:
Code:
use = ExitProcess    
Post 07 Sep 2004, 17:15
View user's profile Send private message Visit poster's website Reply with quote
omega_red



Joined: 13 Mar 2004
Posts: 19
Location: Poland
omega_red
Thanks, the 'use' example did the trick.
Post 07 Sep 2004, 17:36
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-2020, Tomasz Grysztar.

Powered by rwasa.