Q: How to simultaneously inline function and make it dynamic symbol in C/C++? My project links with some external libraries (including some libc) and has a lot of it's own code. I want to override memcpy with my own implementation. In case of project's code I want to always-inline my memcpy while I also want all external libraries to use my memcpy too.
If I define my function as inline void * memcpy(…) then it won't be exported as dynamic symbol, but if I skipped the inline keyword, then I can't guarantee that compiler will try to inline my function wherever possible.
What is a proper way to incline a compiler to inline my function while having it as dynamic symbol for other external libraries?
I link my project statically with -rdynamic flag to expose symbols for override in other dynamic libraries.
