This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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]

Suggested patch to dlltool


Dear friends,

I wonder if I could ask for comments on a suggested patch to dlltool.

I have made the changes to get round the problem I described in my ealier
email.  My motivation here is that I am trying to get g77 working as a
Fortran compiler for matlab, a matrix manipulation language by
Mathworks which is widely used in science.  For some time I have been
supporting gcc C/C++ as a compiler with matlab:

http://www.mrc-cbu.cam.ac.uk/Imaging/gnumex20.html

My problem is that the libraries provided with matlab expect the dll
function names to be decorated (MYFUNC@16), but the matlab Fortran files
do not generate decorated symbols (e.g. MYFUNC).  This is of course not
the usual way round; the WINAPI calls for example do not expect the
dll function names to be decorated, although they are stdcall.

My previous mail gives a test example of the problem, in C.

The only way I have found of successfully linking the matlab dlls to the
Fortran code, is to add an undecorated symbol for the functions in the
.text section of the library generated by dll, so the linker can resolve
the reference.  I have no idea why the fuzzy linking described for ld does
not solve the problem, but it doesn't.

So, I have added an option to dlltool, called --atless-lib-symbol, which
adds the required symbol to the library.  I know that this works on my
system (Win 2000), but I am afraid that I do not know enough about dlls to
know if this is safe, or if it is portable across platforms.  I would be
very grateful indeed for any feedback, suggestions.

Many thanks,

Matthew 

Attachment: dlltool.c.diff
Description: dlltool patch


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