Mail Archives: cygwin/1997/02/11/12:36:30
On 10 Feb 97 at 10:42
Chris Cowan wrote:
> Now the question:
>
> I am wondering how one goes about listing the exported symbol table
> of a *.dll? I tried using nm with no success. Does Mircosoft
> ship a comparable utility to nm?
>
I've attached a code ( I hacked some times ago) to produce a Module
Definition File (.DEF) for MS SDK from object (C/C++) files.
(see http://www.ifh.de/CHEP97/chep97.html
Dynamic libraries: maintaining a single source for Unix &Windows
also).
It works well but must be improved.
This doesn't work with the global variables and constants. I wonder
someone has a skill to make this thing up and complete it.
This must be polished for the object files done with Fortran
compiler too. (The separate story is a Fortran COMMON blocks. For those I
have no right solution at all yet).
I believe this can be done as a separate (FREE !!! ) utility. May
be it needs a separate option to distniguish the brand of the object
file: let's say from MS, Borland, gcc, Symantec, COFF etc.
Alas MS Linker doesn't understand IMPORTS so anyway to access the
global pointers and keep a single source for both platforms as UNIX
as WIN32 one has to change the source to access the global pointers
indirectly (via Set/Get static function for example).
There are other solutions.
1. Jason Tishler <jt AT boxhill DOT com> adviced to use DUMPBIN output and
offered his script to do so.
"I wrote a perl script that automatically generates the DLL
definition file needed to build a C++ DLL. Perhaps it will meet
your needs or at least be a good starting point."
2. Gunther Ebert <gunther DOT ebert AT ixos-leipzig DOT de>
gcc -c <source files>
ar rc <tmplib> <compiled source files (.o)>
ranlib <tmplib>
echo EXPORTS > <.def file>
nm <tmplib> | grep " [CT] " | sed '/ _/s// /' | awk '{print $3;}' >><.def file>
This works fine for me.
Hope this helps,
Valery
=================================================================
Dr. Valery Fine Telex : 911621 dubna su
-----------
LCTA/Joint Inst.for NuclearRes Phone : +7 09621 6 40 80
141980 Dubna, Moscow region Fax : +7 09621 6 51 45
Russia mailto:fine AT main1 DOT jinr DOT dubna DOT su
mailto:fine AT vxcern DOT cern DOT ch
Dr. Valeri Faine
------------ Phone: +41 22 767 6468
CERN FAX : +41 22 782 2601
CH-1211 Geneva, 23 mailto:fine AT vxcern DOT cern DOT ch
Switzerland http://nicewww.cern.ch/~fine
-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -