support clients using standard libraries: STL in particular
From derek.br...@gmail.com on February 19, 2009 13:52:10
This is a key feature to make it easier to write clients. This was PR 200203.
If the library is linked statically and has all of its calls to other libraries and system calls wrapped (and those calls do not interact with other user-mode resources) then it should be safe to use.
We already provide __wrap_malloc, __wrap_realloc, and __wrap_free so clients can easily use ld's -wrap feature to override malloc, realloc, and free at link time. In practice this may be sufficient for many libraries, though there are no guarantees unless we wrap all calls to libc and all raw system calls.
There are still issues with easily creating a version of STL libraries that are PIC but static. It would be nice if we provided instructions for how to do so, since the provided static libraries on more modern Linux distros do not work properly. We got this to work only on a 32-bit system with provided libraries (see api/docs/intro.dox sec_extlibs); on other systems we either hit link-time or run-time errors.
Xref http://www.govirtual.org/message/1110 There are also issues with STL libraries making system calls that hit our vsyscall hook (I put in a debug build check that then suggests -sysenter_is_int80 as a workaround) or bypass our handling.
It would also be nice to have STL support on Windows.
Original issue: http://code.google.com/p/dynamorio/issues/detail?id=30