1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

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

Discussion in 'Embedded' started by VAX9000, Feb 15, 2006.

  1. VAX9000

    VAX9000 Guest

    (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
    http://www.mscpscsi.com/otherfiles/jlochelp.zip. 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
    http://openwatcom.org) to play with the files, because the .obj files
    are uploaded too.

    vax, 9000
     
    VAX9000, Feb 15, 2006
    #1
    1. Advertisements

  2. VAX9000

    VAX9000 Guest

    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
     
    VAX9000, Feb 15, 2006
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.