Solved

Logical Link Error?!

Posted on 1998-06-08
3
203 Views
Last Modified: 2010-04-01
Dear All,
    What are the possible reasons for a module not included in the EXE even though I know I have linked it up using tlink? -> tlink 123.obj 1.obj 2.obj
in this case, 2.obj is not included. (I checked it with a hexeditor)






0
Comment
Question by:whluk
  • 2
3 Comments
 

Author Comment

by:whluk
ID: 1165408
For Supplement for the question above,
      I have linked the program (2.obj) such as
mov ah,4ch
int 21h
 
The hexcode for these two statements are for example
EA 4C
CD 21
And I have linked it up with other modules like this
tlink 123.obj 1.obj 2.obj
After linking, I used hexeditor to view the exe file
and I found that the 2 statements are lost somewhere or even not found in the whole program. when i checked it with td, the instruction for instance was call 0060. but the 0060 address was rubbish or in other words, the 0060 address was pointing to the data segment...
CAn you help?

The best
Jacky


0
 

Author Comment

by:whluk
ID: 1165409
Another Comment,
     The statement call 0060 was a statement pointing to the 2 lost statements.... ie mov ah, 4ch and int 21h

So when i Steped thru call 0060, the content over there was data segment's.



0
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 total points
ID: 1165410
If there are no references to a particular module, then the module will never be loaded. You should put a reference to the symbol by using an extern statement in your other module.

For example, if you created the module with a public symbol (hopefully a function), then you can use

extern void F();

to make a reference to it. Then you need to create a dummy function that makes a call into F:

void Dummy()
{
  F();
}

0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now