Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support clients using standard libraries: STL in particular #30

Closed
derekbruening opened this issue Nov 27, 2014 · 3 comments
Closed

support clients using standard libraries: STL in particular #30

derekbruening opened this issue Nov 27, 2014 · 3 comments

Comments

@derekbruening
Copy link
Contributor

From [email protected] 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

@derekbruening
Copy link
Contributor Author

From [email protected] on April 02, 2009 13:03:36

We may want to share a partial solution with issue #46 and issue #47 :
on Windows we forward a number of common libc routines to ntdll.dll
(PR 219380) and it would be nice to have something similar on Linux but backed by
private libc routines (we would probably shift Windows to use the same routines).

@derekbruening
Copy link
Contributor Author

From [email protected] on February 03, 2011 07:34:07

we may want to provide a C++ allocator that calls DR mem alloc for passing to
all STL constructors, as an alternative to the default allocator and --wrap

on Windows, the private loader ( issue #157 ) is already allowing static or shared C/C++ library use and redirects memory allocation

@derekbruening
Copy link
Contributor Author

From [email protected] on August 04, 2011 12:58:17

Status: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant