delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2001/06/10/21:55:35

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-developers-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com
Message-ID: <032101c0f219$b7d04dc0$0200a8c0@lifelesswks>
From: "Robert Collins" <robert DOT collins AT itdomain DOT com DOT au>
To: <cygwin-developers AT cygwin DOT com>
References: <001f01c0f0e6$72b8ec80$0200a8c0 AT lifelesswks> <20010610004015 DOT D29231 AT redhat DOT com> <23114413578 DOT 20010610185633 AT logos-m DOT ru> <20010610120846 DOT B5292 AT redhat DOT com> <027801c0f210$d1e7c5c0$0200a8c0 AT lifelesswks> <20010610211823 DOT A9379 AT redhat DOT com> <02ee01c0f214$e27d63f0$0200a8c0 AT lifelesswks> <20010610214736 DOT B9379 AT redhat DOT com>
Subject: Re: dll base address
Date: Mon, 11 Jun 2001 11:56:22 +1000
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
X-OriginalArrivalTime: 11 Jun 2001 01:46:17.0457 (UTC) FILETIME=[4E623610:01C0F218]

----- Original Message -----
From: "Christopher Faylor" <cgf AT redhat DOT com>
To: <cygwin-developers AT cygwin DOT com>
Sent: Monday, June 11, 2001 11:47 AM
Subject: Re: dll base address



> >Trivial testcase: build a dll with normal ld witha base address of
> >0x610c0000.  When linking against that .dll have that .dll listed
> >before cygwin1.dll in the imports section.
> >
> >Run that program from bash.  Watch cpu hit 100%.  Run that program
from
> >cmd.exe.  Watch it work :].
> >
> ><snip discussion predicated on incorrect cause of problem>
>
> But, marking the DLL as unrelocatable will mean that the DLL will
never
> be able to be relocated even when it will work perfectly well.

The only time that it will work well is when _every_ program run within
that session (following a chain of fork() and spawn() calls) has _no_
conflicting dlls in the same address space. If any .dll collides and is
listed first, then that spawn() or fork() call will fail. We've been
lucky so far because the default for .dlls is usually 0x10000000. I
found out this problem due to a different default in the ld I'm using.
(Which is apparently due to how Ralf built it, not to ld in general).

> I'm not convinced that this is the best solution.

I agree. IMO the best solution is to make all cross-process data
transfer dll base aware. However that may take quite some time. I don't
see that marking cygwin1.dll (which is essentially the kernel for us)
non relocatable will break any existing application code.

In a nutshell we have three options:
1) Make cygwin1.dll handle different base address cross-process
properly.
2) Mark cygwin1.dll non-relocatable until time and techniques to
implement 1) are found.
3) Ignore the issue until 1) occurs.

I'm very happy to hear of other ways around the issue... but I think a
quite, easy and not dirty fix is entirely appropriate. After all the NT
Kernel address space is not relocatable, and we are performing similar
tasks :].

Rob

P.S. I have a workaround for the .dll's I'm building(set a different
base address), so I'm not affected by this, however the problem is still
there.

> cgf
>

- Raw text -


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