Subject: Building Relocateable DLLs
From: [email-masked] ("Bryan J. Ischo")

6 Jan 1997 19:43:00 -0800
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Reply-To: [email-masked]
Content-Type: text
Original-To: [email-masked]
Original-Sender: [email-masked]

Hi.  I am very new to this list and to Win32 programming and I have a
question which unfortunately may have been answered before.

At the Cygnus web site, there is a page which describes the steps to
build a DLL out of two functions from two .c files, and then how to
build an executable with dependencies on that DLL via an intermediary
..a file.

In step 4 of this process, ld is run to build the DLL as follows:

ld -o foo.dll foo.exp foo.o foo2.o

Later, it is explained that the dll which is built here is
"non-relocatable". So I did a little tinkering to see if a relocatable
DLL could be built.  I noticed that ld has an option (-i, -r, or
--relocateable) to specify "location-independent output".  I used it
as follows:

ld --relocateable -o foo.dll foo.exp foo.o foo2.o

and it seemed to work.  But later when I ran the test program, Windows
NT popped up a dialog stating that the DLL was not in the proper
format.

So obviously there is more to building a relocatable DLL than just
specifying --relocateable to ld.  Does anyone have any idea what else
needs to be done?

Also, any pointers to documentation not mentioned in the Cygnus web
pages would be appreciated.  It seems that cygnus-win32 documentation
is scarce.

A big thanks to Cygnus for the work that has gone into porting the GNU
tools (which are, after all, the best development tools in existence) to
Win32.  If it weren't for their efforts, I wouldn't even be bothering to
try porting my code to NT.

Thanks very much,
Bryan

-- 
------------------------------------------------------------------------
Bryan Ischo                                         mailto:[email-masked]
Mountain View, CA, USA                         http://www.pobox.com/~bji
Linux Aficionado                                         1990 Honda CB-1
-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".