Cygwin gcc/ld doesn't like some DLL filenames...

Jason Tishler Jason.Tishler@dothill.com
Wed Oct 25 13:24:00 GMT 2000


This one is almost embarrassing...

If I create a DLL called python2.0.dll and link with its import library
from a different directory, then the resulting executable crashes.  If I
link in the same directory as the import library, then the resulting
executable runs normally.  If I change the name of the DLL to something
else and link with its import library from a different directory, then
the resulting executable runs normally.

Can anyone explain this strange behavior?  Is there some perl conspiracy
going on here? :,)

The following is the steps to reproduce this problem:

    $ gcc -c sub.c
    $ gcc -c main.c
    $ dlltool --export-all --output-def sub.def sub.o
    $ gcc -shared -Wl,--enable-auto-image-base -o python2.0.dll -Wl,--out-implib=libsub.dll.a sub.def sub.o
    $ mkdir dir
    $ cd dir
    $ gcc ../main.o ../libsub.dll.a -o ../main
    $ cd ..
    $ ./main
          0 [main] main 12817 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
       1292 [main] main 12817 stackdump: Dumping stack trace to main.exe.stackdump

But if I link in the same directory as the import library, then main
executes normally:

    $ gcc main.o libsub.dll.a -o main
    $ ./main
    hello

Or if I change the name of the DLL to something else (i.e., python2.1.dll),
then main also executes normally:

    $ gcc -shared -Wl,--enable-auto-image-base -o python2.1.dll -Wl,--out-implib=libsub.dll.a sub.def sub.o
    Creating library file: libsub.dll.a
    $ cd dir
    $ gcc ../main.o ../libsub.dll.a -o ../main
    $ cd ..
    $ ./main
    hello

See attached for sub.c, main.c, and my cygcheck output.

Thanks,
Jason

-- 
Jason Tishler
Director, Software Engineering       Phone: +1 (732) 264-8770 x235
Dot Hill Systems Corporation         Fax:   +1 (732) 264-8798
82 Bethany Road, Suite 7             Email: Jason.Tishler@dothill.com
Hazlet, NJ 07730 USA                 WWW:   http://www.dothill.com


More information about the Cygwin mailing list