cygwin, dlls and libs

Carlos Pita cpita@tycdigital.com.ar
Wed Apr 25 11:43:00 GMT 2001


Hi all!

    Last 2 nights I went through a nightmare of object file formats, symbol
mangling conventions, etc. when trying to build some python modules with
cygwin. Tonight I ended up building them with borland tools converting the
coff .lib to omf with coff2omf.exe. Then this morning I started to
understand a little more about the big picture, learn a lot about dlltool
(by the way, doc in the binutils manual is very good and they give an
example of building a dll that is three times less convolved than the one
given in cygwin manual -is there any particular reason? both of the methods
work, but the one I understand is the simple one, the other being perhaps
redundant), about .def files (MSDN docs), about __declspec(dllexport) and
_declspec(dllimport) directives (MSDN docs)... a lot of that _imp_*
unresolved references makes sense to me now. But I still have a lot of
questions about the subject so I decided to ask them here:

1) What is contained in .lib import files (both coff and omf)? I'm not
asking about coff and omf formats at all; I only want to know about specific
sections used and the way they are used in the context of dynamic
linking/loading.
2) Can gnu tools cope with these formats? (I read about binutils and BFS and
I know they can, but perhaps gcc can't -although probably it shouldn't as
it's a frontend to the other utilities-. Or perhaps there are conventions
not defined by the formats but historically strongly related with a
particular format).
3) Depending on the response to the previous question: why are we building
those .a (or .dll.a) "stubs"? What is the real reason for not using .lib?
What do they contain?
4) Is there a way to append a '_imp_' prefix to symbols imported by a module
without declaring each one as __declspec(dllimport) in the sources? (Or
perhaps some filter utility which takes a .h and insert this directive
symbols before symbols...?).

I was looking for info on these points before asking here but although I
finded a lot on object file formats or about using specific tools I couldn't
find any really valuable as an answer to 1), 2) or 3). I don't expect
detailed asnwers here but I would be very glad if you can point me to some
(hypotetically) existent resource.

Thanks in advance,
    Carlos





--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list