Mail Archives: cygwin-developers/1998/02/18/00:55:04
Ian Lance Taylor wrote:
>
> I assume you saw the patch I sent out earlier which fixes an apparent
> off by one error in dlltool. I'm not entirely sure whether this patch
> is correct, but it seems to be.
Didn't try it yet.
> I have realized that I was confusing hint numbers and ordinals. The
> hint numbers are not ordinals. They are indexes into the export name
> table.
>
Ordinals are indexes in import table! Hints are checked to validate ordinals. Here is an extract from win32 sdk:
Note that an optimization is available whereby each import library
exports a 32-bit number that corresponds with each function in
addition to any name or ordinal number. This serves as a "hint" to
speed the fixups performed at load time. If the hints in the
application and in the loaded DLL do not match, the loader performs a
binary search based on the function name.
> It's the same I wrote about some time ago! Unfortunately, the bug in g++
> parcer prevents from doing this changes :-(
>
> I don't know what bug you are referring to. I don't understand why a
> bug in g++ would affect something like this.
To declare a pointers to imported functions you should write something like
#include <windows.h>
int (PASCAL *socket) (parameter list);
try to compile this with g++ :-) gcc compiles it fine (so you was able to compile lines like this in tcl. G++ parser fails on lines like
type (__attribute__((attribute_name)) ....)
> Great! So we should clearly rewrite the socket functions to load the
> library as needed. tcl/win/tclWinSock.c has an example of just this
> sort of code if somebody wants to write a patch.
See above :-) Tcl written in C, but cygwin.dll - in C++.
--
Sergey Okhapkin, http://www.lexa.ru/sos
Moscow, Russia
Looking for a job.
- Raw text -