delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/09/23/10:42:10

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <000b01c1443d$8aec99a0$0149a8c0@sknet01>
From: "Stephen Dyke" <sk DOT ml AT btinternet DOT com>
To: "Robert Collins" <robert DOT collins AT itdomain DOT com DOT au>,
"cygwin" <cygwin AT cygwin DOT com>
References: <3BAD12EA DOT 30290 DOT 3EA67560 AT localhost> <002c01c143ab$501470b0$0149a8c0 AT sknet01> <08f701c143f5$d8336560$0200a8c0 AT lifelesswks> <004401c1442e$93973830$0149a8c0 AT sknet01> <0b5701c14432$ff513450$0200a8c0 AT lifelesswks>
Subject: Re: GetModuleHandleA AT 4
Date: Sun, 23 Sep 2001 15:39:25 +0100
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

> > > > Yes I did make some modifications and
> > > > looking to build a package for cygwin,
> > > > that could simply the overly complex
> > > > problem that is building a DLL.
> > >
> > > I'm a little confused here. What's so complex about gcc -o
> > > foo.dll -shared foo.c ?
> > >
> > > Rob
> >
> > This is incorrect, the command you use does not create a relocation
> > section, and has many problems with windows 95 and win98 first
> > edition. furthermore, the dll would suffer from problems with
> > maintaining static variables and threading.
>
> Hmm, thats strange. It creates a .reloc section for me (see below). What
> specific problems does it have with win95 and 98?
>
> Can you enlarge on the issues with static variables and threading?
>
> Also, are you planning on rolling your improvements into ld?
>
> Rob
>
> $ cat foo.c
> int foo;
>
> int bar(int foo1)
> {
>   return (foo1>foo);
> }
> ==
> $ gcc -o foo.dll -shared foo.c
> ==
> $ objdump foo.dll -h
>
> foo.dll:     file format pei-i386
>
> Sections:
> Idx Name          Size      VMA       LMA       File off  Algn
>   0 .text         00000400  10001000  10001000  00000400  2**2
>                   CONTENTS, ALLOC, LOAD, READONLY, CODE
>   1 .data         00000200  10002000  10002000  00000800  2**2
>                   CONTENTS, ALLOC, LOAD, DATA
>   2 .bss          0000010c  10003000  10003000  00000000  2**2
>                   ALLOC
>   3 .edata        00000200  10004000  10004000  00000a00  2**2
>                   CONTENTS
>   4 .idata        00000200  10005000  10005000  00000c00  2**2
>                   CONTENTS, ALLOC, LOAD, DATA
>   5 .reloc        00000200  10006000  10006000  00000e00  2**2
>                   CONTENTS
>   6 .stab         00013800  10007000  10007000  00001000  2**2
>                   CONTENTS, READONLY, DEBUGGING, NEVER_LOAD, EXCLUDE
>   7 .stabstr      0008d200  1001b000  1001b000  00014800  2**0
>                   CONTENTS, READONLY, DEBUGGING, NEVER_LOAD, EXCLUDE
> ==
>
>
>

I am not planning on changing ld, but I am planning to release a set of
script to build dlls, using nothing more than the available tools and the
source for the dll. Expect a beta soon!
:)

As for the static variables and threading, if using mutexes, the locks can
fail repeatedly, despite there being no other lock.
I'm looking into this in some detail, and will release a paper about this as
soon as I get some detailed info on the dll api from some freinds at fort
microsoft.

Stephen



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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