delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/09/07/21:55:36

From: fjh AT cs DOT mu DOT OZ DOT AU (Fergus Henderson)
Subject: Re: problems with linker
7 Sep 1997 21:55:36 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199709070706.RAA12055.cygnus.gnu-win32@mundook.cs.mu.OZ.AU>
References: <19970905153053 DOT 19745 AT bsilx2 DOT iitb DOT fhg DOT de>
Original-To: gnu-win32 AT cygnus DOT com
Original-Cc: aj AT dungeon DOT inka DOT de
Original-Sender: owner-gnu-win32 AT cygnus DOT com

Andreas Jellinghaus <jelling AT iitb DOT fhg DOT de> writes:

>i have big problems with the dynamic linker :
>there is a function Pof_Create that creates a linked list of type void*.
>we have a static table mOblist with entry Create, to typecast this to
>the right type, so we don't need to typecast with every function call.
>The items in this list should have the addresses of the Pof_ functions.
>
>when i link my program (calling the functions in this struct) static with the
>library (the struct and all functions are in this library), everything 
>works ok. but if i create a simple or a relocable dll and link with the dll, 
>the struct has bad values and i get segmentation faults.

If you're accessing a DLL's global or static variables from outside
the DLL, then some additional work is needed.  See
<http://www.cs.mu.oz.au/~fjh/gnu-win32/how-to-build-dlls.html>.

P.S.  For anyone already using the Makefile.DLLs from that WWW page,
I recently updated that with a patch from Sergey, so the main program
no longer needs to explicitly set the DLL's impure_ptr.

--
Fergus Henderson <fjh AT cs DOT mu DOT oz DOT au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh AT 128 DOT 250 DOT 37 DOT 3         |     -- the last words of T. S. Garp.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019