Mail Archives: cygwin/2001/09/23/10:42:10
> > > > 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 -