Help me on John Fine's JLOC: wrong global variable linkage (posted on comp.lang.asm.x86 too)

(I cross post it here because I did not know that group was moderated and might attract more non-tech users.)

Group, I played with JLOC for several days and now I met a problem that puzzled me hard. I linked a .com file with jloc, and I set up data segment at the begining of the .com file to handle a seperate data segment. I have a global variable declared in one .obj file, and used in another .obj file (declared as extern). This variable is not linked correctly as codes from the two .obj files points to two different addresses for the same variable. I compiled the .obj files with /ms parameter (means small code, small data) with watcom c 11.0. I have nothing in _DATA. Data is all in _BSS, so that I am able to link a .com executable and to have seperate data and code segments.

I uploaded all files (complete with source) and you can download from

formatting link
There is a readme.txt file that described this problem in greater detail. Please help me to crack this nuts. Thank you!

Note: You do NOT need to have watcom c 11.0 (downloadble at

formatting link
to play with the files, because the .obj files are uploaded too.

vax, 9000

Reply to
VAX9000
Loading thread data ...

OK, I did some more experiment. JLOC insists to link 2A2A as the address of the variable c90_intr_flag, whatever way I manipulate the base, start, i_start parameters in test.loc configuration file.

So I removed all inter-module references of global variables. I now use functions to communicate between modules. Now a new problem emerges. JLOC linked some wrong extern functions. It substitutes several functions from xxx.obj with functions from yyy.obj. I have the complete set of example for this problem, but as I decide to give up I do not have the desire to post it here. If anybody is interested please send me email.

The basic conclusion is, when the project is complex, say, has a bunch of files other than a single file, JLOC does not work well with Watcom C 11.0.

I may try JLOC with turbo c 2.01 or try the new open watcom 1.4 linker. It is capable to produce raw binary images but I guess it might not be as flexible as JLOC is.

vax, 9000

Reply to
VAX9000

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.