Index

JWlink

About JWlink

JWlink is a linker for x86 that can create 16-, 32- and 64-bit binaries. It's a modified Open Watcom Wlink. Some features have been added and a few bugs have been fixed. Generally, it has been made more compatible with the MS linker (the cmdline syntax is still quite different).

See list of changes for what has been changed compared to OW Wlink.

A manual is also available, in HTMLHelp format for Windows or plain HTML for DOS and Linux.

JWlink's source code is released under the Sybase Open Watcom Public License,

Examples

The JWlink commandline options are vast and the syntax, which is inherited from Wlink, is a bit strange. As a start, here are some examples for the most common cases:
- Win32/Win64 console application,
one object module (sample.obj):
jwlink format windows pe file sample.obj
- Win32/Win64 GUI application,
one object module (sample.obj):
jwlink format windows pe runtime windows file sample.obj
- Win32/Win64 dynamic link library,
one object module (sample.obj):
jwlink format windows pe dll file sample.obj
- Win32/Win64 console application with multiple object modules,
file1.obj and file2.obj, name of the resulting binary will be sample.exe:
jwlink format windows pe dll file file1.obj, file2.obj name sample.exe
- Win32/Win64 console application with one object module,
emit symbolic debugging info and create a map file:
jwlink debug c format windows pe file sample.obj op cvp, map
- Win32/Win64 console application without base relocations: jwlink format windows pe file sample.obj op noreloc
- Win32/Win64 dll and set the preferred base address: jwlink format windows pe dll file sample.obj op offset=0x20000000
- Win32/Win64 dll and write an import library: jwlink format windows pe dll file sample.obj op implib=sample.lib
- Win32 console application compiled with MS VC++: jwlink format windows pe file sample.obj op eliminate, start=_mainCRTStartup, noreloc
- 32- or 64-bit ELF application: jwlink format elf file sample.obj op noreloc

Hints for MS Link and PoLink Users

If you're used to MS link or PoLink, the following table should give an idea about how the arguments are to be translated for JWlink.

MS Link ArgumentJWlink Equivalent
/ALIGN:n OP OBJALIGN=n
/BASE:n OP OFFSET=n
/DLL FORMAT WIN PE DLL
/ENTRY:symbol OP START=symbol
/EXPORT:name EXPORT name
/FILEALIGN:n OP ALIGNMENT=n
/FIXED OP NORELOCS
/FORCE:multiple OP REDEFSOK
/HEAP:res,comm OP HEAPSIZE=res COMMIT HEAP=comm
/IMPLIB:name OP IMPLIB=name
/INCLUDE:symbol REFERENCE symbol
/LARGEADDRESSAWAREOP LARGEADDRESSAWARE
/LIBPATH:path LIBPATH path
/MAP OP MAP
/NODEFAULTLIB OP NODEFAULTLIBS
/NXCOMPAT OP NXCOMPAT
/OSVERSION:maj,minOP OSVERSION=maj.min
/OUT:name NAME name
/SECTION:segm,... SEGMENT segm ...
/STACK:res,comm OP STACK=res COMMIT STACK=comm
/STUB:filename OP STUB=filename
/SUBSYSTEM:system RUNTIME system
library.LIB LIBRARY library
module.OBJ FILE module

There's no direct replacement for MS link's /DEF option, which tells the linker to scan a so-called Module Definition File. However, since the main usage of such files is to define exports, it's simple to replace them with standard linker directive files.

Here's an example. Module Definition File MYDLL.DEF:

    LIBRARY MYDLL
    EXPORTS
     MyFunction1
     MyFunction2
     MyFunction3

can be replaced by linker directive file MYDLL.RSP:

    OP MODNAME=MYDLL
    OP FUZZYEXPORT
    EXPORT {
     MyFunction1
     MyFunction2
     MyFunction3
    }

and that file is added to JWlink's commandline with the @ directive:

jwlink format win pe dll file mydll.obj @MYDLL.RSP

Downloads


Binary Windows

Binary Linux

Binary DOS

Source
JWlink 02/2012 JWlinkbw.zip JWlinkbl.zip JWlinkbd.zip JWlinks.zip

See also: JWasm