flat assembler
Message board for the users of flat assembler.

Index > Windows > Linker Problem, i don't think i got one for FASM :?

Author
Thread Post new topic Reply to topic
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner
hi,
i just walk one step more into the world of FASM.

could somebody tell me what is the linker in the concept of ASM or FASM?
i just use the Depencency Walker to view the created FASM .exe file.
just wish to know, why the Linker Version of the FASM created executables is always 1.54?

where the linker is located? is it a file or another .exe?
or is it a utility that combined with and come with fasm.exe?

in the C concept, we compile the file then link it using linker.
does the linker i mentioned above is the linker we use in linking C compile .obj code, .res?

sincerely,
vbVeryBeginner d(`..')b
http://sulaiman.thefreebizhost.com
Post 18 Aug 2004, 11:12
View user's profile Send private message Visit poster's website Reply with quote
roticv



Joined: 19 Jun 2003
Posts: 374
Location: Singapore
roticv
The "linker" is built into fasm. This means that there is no use for an external linker.
Post 18 Aug 2004, 12:07
View user's profile Send private message Visit poster's website MSN Messenger Reply with quote
mimas



Joined: 21 Jul 2003
Posts: 10
mimas
Hi,

You don't need a linker if you use the PE format. This is only required when creating COFF (MS or not).

The "library" and "import" macro generate the IATand the import table, so Fasm makes all the linking stuff by itself.
Post 18 Aug 2004, 12:07
View user's profile Send private message Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner
thanks, roticv & mimas...

one more question,
if we don't need a linker when using the PE format, then how and why the Depencency Walker shows us the Linker Version?

em.. mimas, care to give me a small description of what is IAT?

sincerely,
vbVeryBeginner d(.~.)b
http://sulaiman.thefreebizhost.com
Post 18 Aug 2004, 14:13
View user's profile Send private message Visit poster's website Reply with quote
mimas



Joined: 21 Jul 2003
Posts: 10
mimas
Well it may be the number that Fasm use to populate the linker's informations in the PE header.

IAT (Import Address Table) is where Windows puts the addresses of the imported functions called by the program. When you create a COFF object, all these imports are indicated externals. The linker resolves all externals and create the necessary tables (IAT & more) to build a "real" executable. This is the masm's way (assembler + linker) or any C compiler's way (compiler + linker), but Fasm is smarter. Smile

If you want a linker, I think that golink may be a good choice. You could use it later if you have to link several binary objects together.
Post 18 Aug 2004, 18:00
View user's profile Send private message Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner
thanks mimas,
i guess i need to bog you down with some more issue related with IAT.

Quote:

from: mimas
When you create a COFF object, all these imports are indicated externals.

1.does this implies that the IAT is stored inside the .obj file?

2.is the addresses of the IAT is static (no change) and same in each computer, eg like the WINAPI function address, or could i call it function entry point?

3.does this means .exe (final complete executable) would not have IAT inside them? or IAT still exists inside the .exe and theoritically we could link it one more time? eg. to link the explorer.exe with our .obj file.. ?

sincerely,
vbVeryBeginner d(@-@)b
http://sulaiman.thefreebizhost.com
Post 18 Aug 2004, 19:43
View user's profile Send private message Visit poster's website Reply with quote
mimas



Joined: 21 Jul 2003
Posts: 10
mimas
1) There are no imports in a COFF Object, just external symbols which have to be linked (and the symbols you are exporting).

2) You don't have to care about IAT, except if you want to understand the PE format. You'd better learn assembly very well at the first time. Fasm handle the PE structure for you, enjoy!

3) Theorically, a PE needs imports and a way to resolve system's API. An executable without it cannot be run and dont have to exist. You can link a binary object with a PE (executable or DLL) to resolve the imports of the object, golink works this way.

Learn Win32 assembly, and when you'll get a higher skill, just take a look at the PE structure to understand it.
Post 18 Aug 2004, 21:16
View user's profile Send private message Reply with quote
silkodyssey



Joined: 02 Oct 2003
Posts: 198
Location: St.Vincent & the Grenadines
silkodyssey
vbVeryBeginner wrote:

why the Linker Version of the FASM created executables is always 1.54?


1.54 is the current version of fasm.

_________________
silkodyssey
Post 18 Aug 2004, 22:14
View user's profile Send private message MSN Messenger Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner
>from: silkodyssey <- thank you
>1.54 is the current version of fasm.

ic, that is logic Wink

>from : mimas <- thank you
>Learn Win32 assembly, and when you'll get a higher skill, just take a
>look at the PE structure to understand it.

ye, maybe will look at that PE structure when i want to modify the LINKER Version in my executable.
i want to set it to 0.0

sincerely,
vbVeryBeginner d(..&)b
Post 19 Aug 2004, 00:29
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
Quote:

2.is the addresses of the IAT is static (no change) and same in each computer, eg like the WINAPI function address, or could i call it function entry point?

Windows API functions addresses are not static - they change between windows versions, and even service packs (and even hotfixes). So you do need an IAT, even if you don't need the "import jumptable" (ie, you can call IAT slots directly).

If you're interested in slightly faster loadspeed on huge programs, have a look at the "bind" utility (should be available with PSDK?) - but never depend on hardcoded addresses.
Post 19 Aug 2004, 01:27
View user's profile Send private message Visit poster's website Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner
>from : fodder
>If you're interested in slightly faster loadspeed on huge programs

he he ... :p, i am in the hello world! state ... :p


~ this thread is SOLVED. vbVeryBeginner d(&.*)b says thanks to those who reply
Post 19 Aug 2004, 05:14
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.