watcom library format

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
kerravon
Member
Member
Posts: 303
Joined: Fri Nov 17, 2006 5:26 am

watcom library format

Post 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....
Octocontrabass
Member
Member
Posts: 5805
Joined: Mon Mar 25, 2013 7:01 pm

Re: watcom library format

Post by Octocontrabass »

rdos
Member
Member
Posts: 3379
Joined: Wed Oct 01, 2008 1:55 pm

Re: watcom library format

Post by rdos »

I think this varies with the type of source file used.
User avatar
iansjack
Member
Member
Posts: 4779
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: watcom library format

Post 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?
rdos
Member
Member
Posts: 3379
Joined: Wed Oct 01, 2008 1:55 pm

Re: watcom library format

Post 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.
User avatar
eekee
Member
Member
Posts: 929
Joined: Mon May 22, 2017 5:56 am
Location: Kerbin
Discord: eekee
Contact:

Re: watcom library format

Post 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.
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
Octocontrabass
Member
Member
Posts: 5805
Joined: Mon Mar 25, 2013 7:01 pm

Re: watcom library format

Post 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.
User avatar
eekee
Member
Member
Posts: 929
Joined: Mon May 22, 2017 5:56 am
Location: Kerbin
Discord: eekee
Contact:

Re: watcom library format

Post 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
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
kerravon
Member
Member
Posts: 303
Joined: Fri Nov 17, 2006 5:26 am

Re: watcom library format

Post by kerravon »

Octocontrabass wrote: Sun May 04, 2025 4:51 pm That looks like OMF.
Thanks for that - that allowed us to progress.
kerravon
Member
Member
Posts: 303
Joined: Fri Nov 17, 2006 5:26 am

Re: watcom library format

Post by kerravon »

kerravon wrote: Mon May 05, 2025 7:23 pm
Octocontrabass wrote: Sun May 04, 2025 4:51 pm That looks like OMF.
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).
Post Reply