Page 1 of 1
watcom library format
Posted: Sun May 04, 2025 4:12 pm
by kerravon
Does anyone know what format Open Watcom uses for libraries, and whether it is documented?
We may be able to have an update to pdld to handle this format.
Thanks. Paul.
D:\watcom\lib386\nt>hexdump kernel32.lib 0 100
000000 F00D0000 7A010061 00000000 00000000 ....z..a........
000010 800D000B 5F6C7374 726C656E 5740343A ...._lstrlenW@4:
000020 88290080 A001000B 5F6C7374 726C656E .)......_lstrlen
000030 5740340C 4B45524E 454C3332 2E444C4C
[email protected]
000040 086C7374 726C656E 57000056 880800C0 .lstrlenW..V....
000050 FE54E79C 7A451C8A 02000074 00000000 .T..zE.....t....
Re: watcom library format
Posted: Sun May 04, 2025 4:51 pm
by Octocontrabass
Re: watcom library format
Posted: Mon May 05, 2025 1:22 am
by rdos
I think this varies with the type of source file used.
Re: watcom library format
Posted: Mon May 05, 2025 1:46 am
by iansjack
rdos wrote: ↑Mon May 05, 2025 1:22 am
I think this varies with the type of source file used.
... and the host operating system?
Re: watcom library format
Posted: Mon May 05, 2025 2:23 am
by rdos
iansjack wrote: ↑Mon May 05, 2025 1:46 am
rdos wrote: ↑Mon May 05, 2025 1:22 am
I think this varies with the type of source file used.
... and the host operating system?
Yes, and probably with bitness and memory model too.
Re: watcom library format
Posted: Mon May 05, 2025 10:28 am
by eekee
An odd little section in our Watcom wiki page states, "Natively, all Watcom C/C++ compilers can produce is OMF (.obj) files by default."
However, I'm seeing different things from the Unix
file command in a binary release of Watcom v2. Libraries (.lib) are OMF, while .obj files are "8086 relocatable (Microsoft)". So yes, the libraries are OMF but they're .lib not .obj.
Re: watcom library format
Posted: Mon May 05, 2025 11:16 am
by Octocontrabass
eekee wrote: ↑Mon May 05, 2025 10:28 amHowever, I'm seeing different things from the Unix
file command in a binary release of Watcom v2. Libraries (.lib) are OMF, while .obj files are "8086 relocatable (Microsoft)".
"8086 relocatable (Microsoft)" is referring to the 8086 flavor of OMF with Microsoft's extensions.
The .lib files are probably also 8086 OMF with Microsoft extensions, but with enough additional headers that file didn't see the 8086-specific or Microsoft-specific parts.
Re: watcom library format
Posted: Mon May 05, 2025 11:37 am
by eekee
Octocontrabass wrote: ↑Mon May 05, 2025 11:16 am
"8086 relocatable (Microsoft)" is referring to the 8086 flavor of OMF with Microsoft's extensions.
Thanks.
Octocontrabass wrote: ↑Mon May 05, 2025 11:16 am
The .lib files are probably also 8086 OMF with Microsoft extensions, but with enough additional headers that file didn't see the 8086-specific or Microsoft-specific parts.
Oh,
file seems to think they come from MS Visual C specifically.

They all have this "Microsoft Visual C/OMF library" tag (which I probably should have pasted before). Example:
lib386/wresfs.lib: Microsoft Visual C/OMF library, page size 16, at 0xde00 dictionary with 11 blocks (FFLAG=full) 1st entry FileShift in page 1, 2nd record "loadfind.c", 3rd record COMMENT Preserved class=0xaa
Re: watcom library format
Posted: Mon May 05, 2025 7:23 pm
by kerravon
Thanks for that - that allowed us to progress.
Re: watcom library format
Posted: Fri May 16, 2025 6:15 am
by kerravon
kerravon wrote: ↑Mon May 05, 2025 7:23 pm
Thanks for that - that allowed us to progress.
And pdld.exe, available (including public domain C90 source code) on the PDOS/386 disk at pdos.org, is now able to handle 32-bit OMF object code and libraries (at least to the extent that I use them as per makefile.pga).