This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Need help figuring out DLL load problem
- From: Danny Backx <danny dot backx at scarlet dot be>
- To: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- Cc: binutils at sourceware dot org
- Date: Thu, 30 Jul 2009 19:59:51 +0200
- Subject: Re: Need help figuring out DLL load problem
- References: <1248970879.5537.415.camel@pavilion> <4A71DFC8.6060908@gmail.com>
- Reply-to: danny dot backx at scarlet dot be
On Thu, 2009-07-30 at 19:00 +0100, Dave Korn wrote:
> Danny Backx wrote:
>
> > 0x00401099 <_Z41__static_initialization_and_destruction_0ii+28>:
> > call 0x404130 <_imp___ZNSt8ios_base4InitC1Ev>
>
> What is at 0x404130? Import table by any chance?
Yes, at that point it still refers to (the import table reference of)
the constructor :
pavilion: {350} fgrep 0x404130 *.exe.od*
hello2.exe.od.dSg:void __imp___ZNSt8ios_base4InitC1Ev /* 0x404130 */;
pavilion: {351}
Also I forgot to mention binutils version :
pavilion: {350} i386-mingw32ce-objdump -v
GNU objdump (GNU Binutils) 2.19.51.20090204
> > 0x00401099 <_Z41__static_initialization_and_destruction_0ii+28>:
> > call 0x423517be
>
> > The call statement (last line) doesn't look right. It even points to a
> > location outside the DLL, or so it seems :
>
> > 0x41ee1000 0x41fb2990
> > Yes /opt/x86mingw32ce/i386-mingw32ce/lib/libstdc++-6.dll
> > No \Windows\coredll.dll
>
> I wonder if somehow an auto-import fixup is being applied to something that is
> in fact a jump to an import stub. Let's have a look at the output of "objdump
> -p" on the exe.
>
> cheers,
> DaveK
pavilion: {349} i386-mingw32ce-objdump -p hello2.exe
hello2.exe: file format pei-i386
Characteristics 0x107
relocations stripped
executable
line numbers stripped
32 bit words
Time/Date Sun Jul 26 21:24:00 2009
Magic 010b (PE32)
MajorLinkerVersion 2
MinorLinkerVersion 56
SizeOfCode 00000800
SizeOfInitializedData 00000e00
SizeOfUninitializedData 00000200
AddressOfEntryPoint 00001000
BaseOfCode 00001000
BaseOfData 00002000
ImageBase 00400000
SectionAlignment 00001000
FileAlignment 00000200
MajorOSystemVersion 4
MinorOSystemVersion 0
MajorImageVersion 1
MinorImageVersion 0
MajorSubsystemVersion 4
MinorSubsystemVersion 0
Win32Version 00000000
SizeOfImage 00014000
SizeOfHeaders 00000400
CheckSum 00014787
Subsystem 00000003 (Windows CUI)
DllCharacteristics 00000000
SizeOfStackReserve 00200000
SizeOfStackCommit 00001000
SizeOfHeapReserve 00100000
SizeOfHeapCommit 00001000
LoaderFlags 00000000
NumberOfRvaAndSizes 00000010
The Data Directory
Entry 0 00000000 00000000 Export Directory [.edata (or where ever we
found it)]
Entry 1 00004000 000002c0 Import Directory [parts of .idata]
Entry 2 00000000 00000000 Resource Directory [.rsrc]
Entry 3 00000000 00000000 Exception Directory [.pdata]
Entry 4 00000000 00000000 Security Directory
Entry 5 00000000 00000000 Base Relocation Directory [.reloc]
Entry 6 00000000 00000000 Debug Directory
Entry 7 00000000 00000000 Description Directory
Entry 8 00000000 00000000 Special Directory
Entry 9 00000000 00000000 Thread Storage Directory [.tls]
Entry a 00000000 00000000 Load Configuration Directory
Entry b 00000000 00000000 Bound Import Directory
Entry c 00000000 00000000 Import Address Table Directory
Entry d 00000000 00000000 Delay Import Directory
Entry e 00000000 00000000 CLR Runtime Header
Entry f 00000000 00000000 Reserved
There is an import table in .idata at 0x404000
The Import Tables (interpreted .idata section contents)
vma: Hint Time Forward DLL First
Table Stamp Chain Name Thunk
00004000 0000408c 00000000 00000000 00004298 000040f8
DLL Name: COREDLL
vma: Hint/Ord Member-Name Bound-To
4144 439 GetModuleFileNameW
415a 1125 TerminateProcess
416e 1274 _fcloseall
417c 1282 _fpreset
4188 1403 fflush
4192 1420 free
419a 1508 malloc
41a4 1557 realloc
41ae 1570 strchr
41b8 1573 strcspn
41c2 1580 strspn
41cc 1642 wcslen
41d6 1653 wcstombs
00004014 000040c4 00000000 00000000 000042b0 00004130
DLL Name: libstdc++-6.dll
vma: Hint/Ord Member-Name Bound-To
41e4 2744 _ZNSt8ios_base4InitC1Ev
4200 2746 _ZNSt8ios_base4InitD1Ev
421c 2984 _ZSt4cout
4228 3060
_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
00004028 000040d8 00000000 00000000 000042b0 0000106d
DLL Name: libstdc++-6.dll
vma: Hint/Ord Member-Name Bound-To
421c 2984 _ZSt4cout
0000403c 000040e0 00000000 00000000 000042b0 00001072
DLL Name: libstdc++-6.dll
vma: Hint/Ord Member-Name Bound-To
4228 3060
_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
00004050 000040e8 00000000 00000000 000042b0 0000109a
DLL Name: libstdc++-6.dll
vma: Hint/Ord Member-Name Bound-To
41e4 2744 _ZNSt8ios_base4InitC1Ev
00004064 000040f0 00000000 00000000 000042b0 000010b5
DLL Name: libstdc++-6.dll
vma: Hint/Ord Member-Name Bound-To
4200 2746 _ZNSt8ios_base4InitD1Ev
00004078 00000000 00000000 00000000 00000000 00000000
pavilion: {350}
--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info