This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Need help figuring out DLL load problem
Danny Backx wrote:
> The Import Tables (interpreted .idata section contents)
> vma: Hint Time Forward DLL First
> Table Stamp Chain Name Thunk
> 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
> 00004050 000040e8 00000000 00000000 000042b0 0000109a
>
> DLL Name: libstdc++-6.dll
> vma: Hint/Ord Member-Name Bound-To
> 41e4 2744 _ZNSt8ios_base4InitC1Ev
That confirms my theory. The call at 0x00401099 should go to
_imp___ZNSt8ios_base4InitC1Ev at 0x404130, but then the auto-import fixup
relocation goes and gets applied to it. The resulting address should be the sum
of the real address and the import stub address, so
0x423517be = _ZNSt8ios_base4InitC1Ev + 0x404130
or in other words, _ZNSt8ios_base4InitC1Ev = 0x41F4D68E, which is inside the
DLL's address range as it should be.
Your mission then is to figure out why LD is generating an auto-import fixup
entry, when this is not a data reference. Take a look at pe_find_data_imports()
in ld/emultempl/pe.em, that's where they all get generated.
cheers,
DaveK