This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

binutils: dlltool DATA exports incompatible with auto-import


GNOME Evolution contains several interdependent libraries, so on Cygwin/MinGW the build creates artificial import libraries with dlltool from .def files. While trying to build 2.28 I came across a possible incompatibility between the implib generated by dlltool and auto-import linkage:

$ gcc -shared -Wl,--out-implib,libtest.dll.a -o cygtest.dll libtest.c
Creating library file: libtest.dll.a

$ nm libtest.dll.a | grep -v ' [bdit] '

d000003.o:
00000000 I _cygtest_dll_iname

d000000.o:
00000000 I __head_cygtest_dll
         U _cygtest_dll_iname

d000002.o:
         U __head_cygtest_dll
00000000 I __imp__test_func
00000000 T _test_func

d000001.o:
         U __head_cygtest_dll
00000000 I __imp__test_data
00000000 I __nm__test_data

$ gcc -o test.exe test.c libtest.dll.a

# now let's try with dlltool
$ dlltool --dllname cygtest.dll --input-def libtest.def --output-lib libtest.dll.a


$ nm libtest.dll.a | grep -v ' [bdit] '

deobt.o:
00000000 I __libtest_dll_a_iname

deobh.o:
00000000 I __head_libtest_dll_a
         U __libtest_dll_a_iname

deobs00001.o:
         U __head_libtest_dll_a
00000000 I __imp__test_func
00000000 T _test_func

deobs00000.o:
         U __head_libtest_dll_a
00000000 I __imp__test_data
# Note no __nm__test_data auto-import here

$ gcc -o test.exe test.c libtest.dll.a
fu000001.o:(.idata$2+0xc): undefined reference to `_libtest_dll_a_iname'
nmth000000.o:(.idata$4+0x0): undefined reference to `__nm__test_data'
collect2: ld returned 1 exit status


Yaakov

Attachment: libtest.c
Description: Text document

Attachment: libtest.def
Description: Text document

Attachment: test.c
Description: Text document

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]