On Debian GNU/Linux 5.0 (lenny). Python 2.5.2-3.
When python is embedded in a shared library (in my case a plugin), the
_mysql.so component of MySQLdb fails to load, due to this error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: /var/lib/python-support/python2.5/_mysql.so: undefined
Discovered while trying to use the ida2sql.py script within IDAPython.
A simple example program is attached demonstrating the problem clearly,
this sample program also demonstrates a work-around, by setting the
RTLD_GLOBAL flag when loading the shared library, the necessary python
symbols are exported for _mysql.so and it loads correctly. Unfortunately
this isn't possible in my situation since IDA Pro is not open source,
and in general I think it's unwise for an application to export all the
symbols from any plugins it may load as there is a high probability of a
I have also been able to work around this issue by re-linking _mysql.so
and including a direct dependancy on libpython2.5.so.1.0. This may not
be the right thing to do when using MySQLdb from the standard python
you can compile
Log in to post a comment.