flat assembler
Message board for the users of flat assembler.

Index > Main > How I may link several .obj files???

Author
Thread Post new topic Reply to topic
4min



Joined: 29 Apr 2008
Posts: 2
4min 29 Apr 2008, 11:23
Hi All!
I only start to use FASM and something I do not understand.
For example, there are several .obj files:
first.obj, second.obj, etc.
How I can link these files?
Furthermore, from the first I want to call the procedure, declared in the second.
Is it correctly to declare it in the first file on such manner:
extern MyProc (without the parameters)?
Or I must use other ways?
As a result I want to obtain the .bin - file.

Experts FASM can you help me???
Post 29 Apr 2008, 11:23
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 29 Apr 2008, 11:32
Quote:
As a result I want to obtain the .bin - file.

This is the problem: bin file has no strictly defined layout - how the linker should know how to position and group segments?

I think what you want is not possible with MS linker. It is possible with linux ld using something called "linker script", but I think it is a bit advanced thing, I never used it.
Post 29 Apr 2008, 11:32
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
4min



Joined: 29 Apr 2008
Posts: 2
4min 29 Apr 2008, 11:54
But linking isn't the problem? How?
Post 29 Apr 2008, 11:54
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 29 Apr 2008, 12:04
to link with MS linker to .exe, you just have to do something like this:

Code:
link /subsystem:console /entry:<symbol> /nodefaultlib object1.obj object2.obj    
Post 29 Apr 2008, 12:04
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
daniel.lewis



Joined: 28 Jan 2008
Posts: 92
daniel.lewis 30 Apr 2008, 06:56
No idea.

This is one of those moments when I wonder if all the abstraction and obfuscation and complication of using programming languages and compilers was ever really worth it.

*pauses in contemplation*

It doesn't matter. The deed is done.

_________________
dd 0x90909090 ; problem solved.
Post 30 Apr 2008, 06:56
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 30 Apr 2008, 08:50
Quote:
This is one of those moments when I wonder if all the abstraction and obfuscation and complication of using programming languages and compilers was ever really worth it.

It is. You'll learn when you try to code something big, or try to mix other people's code to yours, etc...
Post 30 Apr 2008, 08:50
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4073
Location: vpcmpistri
bitRAKE 30 Apr 2008, 14:04
It is true when:

(time to code function yourself) > (time to learn interface of function of 'other')
and (goal is to complete project in minimal time)

If you enjoy coding then maybe doing it yourself is the goal.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 30 Apr 2008, 14:04
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 30 Apr 2008, 14:39
Sure, but if you want to reach big goals, "do everything yourself" may be impossible. For small goals it is fine, and for sure more fun than learrning other's interfaces.
Post 30 Apr 2008, 14:39
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
daniel.lewis



Joined: 28 Jan 2008
Posts: 92
daniel.lewis 01 May 2008, 00:05
I have a scripting engine and compiler I've been writing, and have reverse engineered three complete operating systems.

IDA Pro makes it easier for a reverser to understand a program than most programmers get from source code view. Yay for flow control graphs! I just wish I could click and type assembler into them.

_________________
dd 0x90909090 ; problem solved.
Post 01 May 2008, 00:05
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 01 May 2008, 00:38
daniel: hi - my response was meant for BitRake, - but still: if you want to make you your own project, go own, otherwise keep out of way. I don't mean ABSOLUTELY no harm, but stilll, it was WF
Post 01 May 2008, 00:38
View user's profile Send private message Visit poster's website AIM Address MSN Messenger 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.