This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: GetModuleHandleA@4


----- Original Message -----
From: "Stephen Dyke" <sk.ml@btinternet.com>


> > > 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
==



--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]