Mail Archives: cygwin/2009/03/16/21:40:25
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 -