delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/03/16/21:40:25

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.3 required=5.0 tests=AWL,BAYES_50,SARE_BAYES_5x8,SARE_BAYES_6x8,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <49BF0F84.5040109@gmail.com>
Date: Tue, 17 Mar 2009 02:48:36 +0000
From: Dave Korn <dave DOT korn DOT cygwin AT googlemail DOT com>
User-Agent: Thunderbird 2.0.0.17 (Windows/20080914)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: under cygwin, zsh cannot run when built against ncurses9-5.7-13
References: <20a807210903131414g62e0a53cyefd3938c3fe8af33 AT mail DOT gmail DOT com> <49BADAC1 DOT 80709 AT cwilson DOT fastmail DOT fm> <gpf7kk$2g6$1 AT ger DOT gmane DOT org> <gpfcdo$a30$1 AT ger DOT gmane DOT org> <gpgeu9$iuo$1 AT ger DOT gmane DOT org> <Pine DOT LNX DOT 4 DOT 64 DOT 0903142203230 DOT 9859 AT gremlin DOT fruitbat DOT org> <49BD16E3 DOT 3090506 AT gmail DOT com> <Pine DOT LNX DOT 4 DOT 64 DOT 0903151315370 DOT 9859 AT gremlin DOT fruitbat DOT org>
In-Reply-To: <Pine.LNX.4.64.0903151315370.9859@gremlin.fruitbat.org>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Peter A. Castro wrote:

> file d3.c:
> ----------------------------------------------------------------
> #include <math.h>
> 
> double my_pow( double d1, double d2 )
> {
>   double d;
>   d = pow(d1,d2);
>   return d;
> }
> ----------------------------------------------------------------
> 
> $ gcc -g -shared -o d3.dll d3.c -lm -lc
> $ objdump -x d3.dll

>         DLL Name: cygwin1.dll
>         vma:  Hint/Ord Member-Name Bound-To

>         412c     1285  pow
> 
>  00004014       00004070 00000000 00000000 0000416c 000040a4
> 
>         DLL Name: cygwin1.dll
>         vma:  Hint/Ord Member-Name Bound-To
>         412c     1285  pow

> Why is 'pow' being pulled in twice?  

  Dunno.  I can't reproduce it.  There must be some environment difference
between your system and mine.  You didn't specify whether you were using gcc3
or gcc4 for that example, so I tried them both, and neither reproduced:

$ cat d3.c
#include <math.h>

double my_pow( double d1, double d2 )
{
  double d;
  d = pow(d1,d2);
  return d;
}

$ gcc-3 -g -shared -o d3.dll d3.c -lm -lc
$ objdump -x d3.dll > with-3.txt
$ gcc-4 -g -shared -o d3.dll d3.c -lm -lc
$ objdump -x d3.dll > with-4.txt
$ diff -pu with-3.txt with-4.txt
--- with-3.txt  2009-03-17 02:34:40.468750000 +0000
+++ with-4.txt  2009-03-17 02:34:56.515625000 +0000
@@ -3,7 +3,7 @@ d3.dll:     file format pei-i386
 d3.dll
 architecture: i386, flags 0x0000013b:
 HAS_RELOC, EXEC_P, HAS_DEBUG, HAS_SYMS, HAS_LOCALS, D_PAGED
-start address 0x10001050
+start address 0x69b41120

  Note this change, it could be relevant.  GCC-4 passes the
'--enable-auto-image-base' option to the linker, which is supposed to help us
avoid fork errors in future.  Here are the import tables:


@@ -61,52 +61,53 @@ Entry d 00000000 00000000 Delay Import D
 Entry e 00000000 00000000 CLR Runtime Header
 Entry f 00000000 00000000 Reserved

-There is an import table in .idata at 0x10004000
+There is an import table in .idata at 0x69b46000

 The Import Tables (interpreted .idata section contents)
  vma:            Hint    Time      Forward  DLL       First
                  Table   Stamp     Chain    Name      Thunk
- 00004000      00004040 00000000 00000000 00004160 00004078
+ 00006000      00006040 00000000 00000000 0000617c 0000607c

        DLL Name: cygwin1.dll
        vma:  Hint/Ord Member-Name Bound-To
-       40ac      351  _impure_ptr
-       40bc      720  calloc
-       40c8      779  cygwin_detach_dll
-       40dc      781  cygwin_internal
-       40f0      802  dll_dllcrt0
-       4100      917  free
-       4108     1183  malloc
-       4114     1282  pow
-       411c     1392  realloc
+       60b4      351  _impure_ptr
+       60c4      720  calloc
+       60d0      779  cygwin_detach_dll
+       60e4      781  cygwin_internal
+       60f8      802  dll_dllcrt0
+       6108      917  free
+       6110     1183  malloc
+       611c     1282  pow
+       6124     1392  realloc

- 00004014      0000406c 00000000 00000000 00004170 000040a4
+ 00006014      0000606c 00000000 00000000 00006190 000060a8

        DLL Name: KERNEL32.dll
        vma:  Hint/Ord Member-Name Bound-To
-       4128      337  GetModuleHandleA
+       6130      337  GetModuleHandleA
+       6144      364  GetProcAddress

- 00004028      00000000 00000000 00000000 00000000 00000000
+ 00006028      00000000 00000000 00000000 00000000 00000000


  As you see, they have sane-looking differences in the VMAs, and neither of
them imports cygwin1.dll twice.

> Again, I'm not sure where to go next.

  Might be worth trying a fresh build of binutils from CVS.  I've just
completed a build of zsh and it exhibits the problem, so I'll see if I can
figure out what's gone wrong.

  BTW to avoid confusion can everyone in this thread please remember to take
care and specify explicit version number suffixes on any examples they show
using gcc!

    cheers,
      DaveK


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.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