This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: LD_PRELOAD and C++ code


Dan Myers <dmyers@umiacs.umd.edu> writes:

> 	I have a question about using LD_PRELOAD/dlsym() to wrap library functions.
> Specifically, suppose I have some program compiled with gcc, and some shared
> library of wrapper functions that use C++ and are compiled with g++. Assuming
> the wrapper functions are declared extern "C", should I expect this to work?
> It seems to work in some cases but not in others, so I'm curious if anyone has
> a definitive answer.

If the wrapper functions are extern "C", and you are only passing them
C data types--no classes with virtual functions or references or
anything like that--then you can reasonably expect it to work.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]