delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/03/03/09:08:29

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Sender: tjh AT quadstone DOT com
Message-ID: <36DD41B4.BF1C00D7@quadstone.com>
Date: Wed, 03 Mar 1999 14:05:40 +0000
From: T J Harding <tjh AT quadstone DOT com>
Organization: Quadstone
X-Mailer: Mozilla 4.5 [en] (X11; I; SunOS 5.6 sun4u)
X-Accept-Language: en
MIME-Version: 1.0
To: cygwin AT sourceware DOT cygnus DOT com
Subject: How to handle variables (data, etc.) in DLLs?

--------------E973D53D67A963B1B3C1AB74
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi

I was porting something to Cygwin and all was going swimmingly, until I
ran into problems building a DLL from object code with global data
symbols (i.e.
nm shows these symbols as type D or C).

Just to make it clearer, a trivial example:

main.c might contain:

extern int foo;
extern void bar(void);
int main ( int argc, char **argv )
{
  foo++;
  bar();
}

and foo.c might contain:

int foo=0;
void bar(void)
{
  foo--;
}

It is foo.o that I want to include in a DLL.

I was using dllwrap 0.2.4 (and dlltool 2.9.4) with b20.1 (95 and NT).
"dllwrap --export-all-symbols" exports the data symbols to the .def
file, but
they seem to be exported as if they were functions, resulting in a core
dump
when a.exe is run.  I've tried putting "DATA" after the symbol name in
the
.def file, which results in the symbol being undefined in the import-lib
libfoo.a, meaning I have to link foo.o in as well as libfoo.a.

So how should one best deal with this situation?  It's not my code, so I
don't 
want to have to alter it significantly just to port it.

Tim
--------------E973D53D67A963B1B3C1AB74
Content-Type: text/x-vcard; charset=us-ascii;
 name="tjh.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for T J Harding
Content-Disposition: attachment;
 filename="tjh.vcf"

begin:vcard 
n:Harding;Tim
tel;cell:+44 961 444986
tel;fax:+44 131 220 4492
tel;work:+44 131 220 4491
x-mozilla-html:TRUE
url:www.quadstone.com
org:Quadstone
adr:;;16 Chester Street;Edinburgh;Scotland;EH3 7RA;United Kingdom
version:2.1
email;internet:tjh AT quadstone DOT com
title:Decisionhouse Services
x-mozilla-cpt:;-1080
fn:Tim Harding
end:vcard


--------------E973D53D67A963B1B3C1AB74
Content-Type: text/plain; charset=

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
--------------E973D53D67A963B1B3C1AB74--

- Raw text -


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