File: //proc/3/root/proc/2/cwd/usr/lib/python2.4/Tools/scripts/nm2def.pyc
mņ
=5Dc @ s± d Z d k Z d k Z d k Z d e i d d Z d e i d e i d d Z d Z e d d
Z d Z d Z
f Z e d Z d Z
e d j o e
n d S( sE nm2def.py
Helpers to extract symbols from Unix libs and auto-generate
Windows definition files from them. Depends on nm(1). Tested
on Linux and Solaris only (-p option to nm is for Solaris only).
By Marc-Andre Lemburg, Aug 1998.
Additional notes: the output of nm is supposed to look like this:
acceler.o:
000001fd T PyGrammar_AddAccelerators
U PyGrammar_FindDFA
00000237 T PyGrammar_RemoveAccelerators
U _IO_stderr_
U exit
U fprintf
U free
U malloc
U printf
grammar1.o:
00000000 T PyGrammar_FindDFA
00000034 T PyGrammar_LabelRepr
U _PyParser_TokenNames
U abort
U printf
U sprintf
...
Even if this isn't the default output of your nm, there is generally an
option to produce this format (since it is the original v7 Unix format).
Nt libpythoni s .at Pythoni i s .dlls nm -p -g %st Tt Ct Dc C sŪ t i t | i } g } | D] } | | i q$ ~ } h } x | D] } t | d j p
d | j o qM n | i } t | d j o qM n | \ } } }
| | j o qM n | | f | |
<qM W| S( Ni t :i ( t ost popent NMt libt readlinest linest _[1]t st stript symbolst linet lent splitt itemst addresst typet namet types( R R R R R R R R
R R R ( ( t* /usr/lib/python2.4/Tools/scripts/nm2def.pyR + s '
c C s” g } g } xS | i D]E \ } \ } } | d j o | i d | q | i d | q W| i | i d | i d i | d d i | S( NR R s t s DATA
s
( R R (
t datat codeR R R t addrR t appendt sortt join( R R R R R R ( ( R t export_list<