delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/02/18/00:55:04

From: sos AT prospect DOT com DOT ru (Sergey Okhapkin)
Subject: RE: Optimizing memset/memcpy/strcpy/etc.
18 Feb 1998 00:55:04 -0800 :
Message-ID: <01BD3C5F.BDB1AEA0.cygnus.cygwin32.developers@gater.krystalbank.msk.ru>
To: "'Ian Lance Taylor'" <ian AT cygnus DOT com>
Cc: "cygwin32-developers AT cygnus DOT com" <cygwin32-developers AT cygnus DOT com>

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019