Need help figuring out DLL load problem

Danny Backx danny.backx@scarlet.be
Thu Aug 6 21:30:00 GMT 2009


On Wed, 2009-08-05 at 21:53 +0200, Danny Backx wrote:
> On Wed, 2009-08-05 at 20:57 +0200, Danny Backx wrote:
> > On Wed, 2009-08-05 at 20:03 +0100, Dave Korn wrote:
> > >   It gets called from pe_dll_generate_implib() according to what it's parsed
> > > from the .def file.  Check that dlltool hasn't bogusly emitted the .def file
> > > listing as a DATA export; otherwise the problem may be in ld's parsing and
> > > handling of it.
> > 
> > You're right about the DATA entries.
> > 
> > I just discovered 5 minutes ago that the DATA in the .def file is indeed
> > a difference (I grepped wrong, forgot to remove an underscore, so I
> > didn't see that an hour ago).
> > 
> > Editing the .def file for this particular set of
> > constructors/destructors gets the application beyond that point. But it
> > still fails.
> > 
> > That's most likely due to the DATA entries for other stuff in the .def
> > file : there are 1175 such lines on my ARM .def file, and 3801 in the
> > i386 .def file :-(
> > 
> > 	Danny
> 
> I have trouble figuring out what's causing this, or where this field
> (the BSF_FUNCTION ?) is set. Any bright ideas ?
> 
> 	Danny

Here is what's going wrong in a simple example.

Go get it at http://danny.backx.info/download/cegcc/bad-dll.tar.gz .

	Danny

pavilion: {503} make
i386-mingw32ce-g++ -c demodll.C
i386-mingw32ce-ar crv libx.a demodll.o
a - demodll.o
i386-mingw32ce-ranlib libx.a
i386-mingw32ce-dlltool --output-def libx.def --export-all libx.a
i386-mingw32ce-g++ --shared -o libx.dll \
                -Wl,--out-implib,libx.dll.a libx.def \
                libx.a -lgcc
Creating library file: libx.dll.a
pavilion: {504} l
total 52
-rw-rw-r-- 1 danny danny   353 2009-08-06 23:28 demodll.C
-rw-rw-r-- 1 danny danny  1232 2009-08-06 23:28 demodll.o
-rw-rw-r-- 1 danny danny  1408 2009-08-06 23:28 libx.a
-rw-rw-r-- 1 danny danny   181 2009-08-06 23:28 libx.def
-rwxrwxr-x 1 danny danny 25946 2009-08-06 23:28 libx.dll
-rw-rw-r-- 1 danny danny  2520 2009-08-06 23:28 libx.dll.a
-rw-rw-r-- 1 danny danny   516 2009-08-06 23:25 Makefile
pavilion: {505} cat *def
; i386-mingw32ce-dlltool --output-def libx.def --export-all libx.a
EXPORTS
;       cpp()
        _Z3cppv @ 1 DATA
;       DllMain(void*, unsigned long, void*)
        _Z7DllMainPvmS_ @ 2 DATA
        doit @ 3 DATA
pavilion: {506} tar cfvz /tmp/bad-dll.tar.gz *
demodll.C
demodll.o
libx.a
libx.def
libx.dll
libx.dll.a
Makefile
pavilion: {507} l /tmp/bad-dll.tar.gz 
-rw-rw-r-- 1 danny danny 8459 2009-08-06 23:28 /tmp/bad-dll.tar.gz


-- 
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info



More information about the Binutils mailing list