Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Oct 1996 08:50:50 -0400 (EDT)
From:      Thomas David Rivers <ponds!rivers@dg-rtp.dg.com>
To:        Charles_Boatwright@cisnc.canon.com, ponds!FreeBSD.ORG!freebsd-hackers
Subject:   Re: x86 COFF with FreeBSD
Message-ID:  <199610051250.IAA05158@lakes.water.net>

next in thread | raw e-mail | index | archive | help
> 
> Hey,
> 
> I hope that this isn't a "beaten to death question."
> 
> I have a MSVC COFF library, from MSVC 4., 
> I need to link it under FreeBSD.
> 
> The facts. 
> 
> The library is C, not C++ (no name mangling).
> The library is portable (no OS specific calls, only standard C).
> The library is 32 bit.
> The library is HUGE > 4 Meg; > 30 000 functions.
> NO SOURCE.  
> 
> The needs:
> 
> 	Link library with gnu ld to produce an a.out.
> 
> Knowledge of problem.
> 
> 	Used cygnus tool chain on X86-cygwin32 to begin BFD - COFF research.
> 	No success.
> 
> Does anyone know how this can be done, or can it be done????
> 
> Any help, ideas, books in which to read things, places in which to bury
> my head  (a bucket of sand???)  would be excellent.
> 
> TIA

 This can be done - but it's not easy...  I know it can be done because
the group I manage at work is responsible for tools that make something
close to this possible.


 Your first issue is to understand the COFF format produced by MSCV4 -
you'll find that Microsoft is now documenting all of that stuff quite
well (you can find it on MSN, for example.)

 Then, after writing your own linker that handles FreeBSD .o's and
this library; you'll have the problem of call/return stacks...  it's
quite possible they are different.

 To handle that, you'll have to add keywords (or some other machinations)
to the C that you compile on the FreeBSD side, and alter the C compiler.

 Then, after that, you'll have to consider sizes and alignments of data.
With luck, they'll all be the same.  Although I know MSC has extensions
to allow arbitrary bitfield alignment, and some other items that may
make this a problem....

	- Good Luck! -
	- Dave Rivers -




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610051250.IAA05158>