delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2000/07/12/14:08:58

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: <779F20BCCE5AD31186A50008C75D9979171746@silldn_mail1.sanwaint.com>
From: "Fifer, Eric" <EFifer AT sanwaint DOT com>
To: "'cygwin-developers AT sourceware DOT cygnus DOT com'"
<cygwin-developers AT sourceware DOT cygnus DOT com>
Subject: RE: _impure_ptr uninitialized in DLLs?
Date: Wed, 12 Jul 2000 19:03:07 +0100
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)

>This should be fixed in CVS now.  It will require updating libcygwin.a.

I'm still having problems.  The dlopen() flavor works now, but when
linking against a normal DLL, environ is NULL in the main program.

Here's another demonstration:

d.c:

#include <unistd.h>

int __declspec(dllexport) d()
{
    printf("in d\n");
    printf("environ=%x\n", environ);
}

m.c:

#include <unistd.h>

main(int argc, char **argv, char **envp) {
    printf("envp=%x\n", envp);
    printf("environ=%x\n", environ);
    d();
    printf("environ=%x\n", environ);
}

build:

gcc -g -c d.c
dllwrap --output-lib libd.a --dllname libd.dll d.o
gcc -g -c m.c
gcc -o m m.o -L. -Wl,--Bstatic -ld -Wl,--Bdynamic

run:

envp=a040008
environ=0
in d
environ=a040008
environ=0

Thanks,

Eric Fifer

- Raw text -


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