]>
code.delx.au - pulseaudio/blob - src/depmod.py
9 for fn
in sys
.argv
[1:]:
10 f
= os
.popen("nm '%s'" % fn
, "r")
12 imported_symbols
[fn
] = []
15 sym_address
= line
[:7].strip()
16 sym_type
= line
[9].strip()
17 sym_name
= line
[11:].strip()
19 if sym_name
in ('_fini', '_init'):
22 if sym_type
in ('T', 'B', 'R', 'D' 'G', 'S', 'D'):
23 if exported_symbols
.has_key(sym_name
):
24 sys
.stderr
.write("CONFLICT: %s defined in both '%s' and '%s'.\n" % (sym_name
, fn
, exported_symbols
[sym_name
]))
26 exported_symbols
[sym_name
] = fn
27 elif sym_type
in ('U',):
28 if sym_name
[:3] == 'pa_':
29 imported_symbols
[fn
].append(sym_name
)
34 unresolved_symbols
= {}
36 for fn
in imported_symbols
:
39 for sym
in imported_symbols
[fn
]:
40 if exported_symbols
.has_key(sym
):
41 if exported_symbols
[sym
] not in dependencies
[fn
]:
42 dependencies
[fn
].append(exported_symbols
[sym
])
44 if unresolved_symbols
.has_key(sym
):
45 unresolved_symbols
[sym
].append(fn
)
47 unresolved_symbols
[sym
] = [fn
]
49 for sym
, files
in unresolved_symbols
.iteritems():
50 print "WARNING: Unresolved symbol '%s' in %s" % (sym
, `files`
)
52 k
= dependencies
.keys()
55 dependencies
[fn
].sort()
56 print "%s: %s" % (fn
, string
.join(dependencies
[fn
], " "))