So we have shared library from a vendor who won't deliver their library in a static archive .a format on Linux or Android (but does on other platforms) because it would be inconvenient for them to change their build process. The issue is that need to wrap thread creation, malloc, and ton of other apis to work around bugs in the platform's nonstandard libc. We do this with LD using the "--wrap" command to redirect functions to our wraps. Unfortunately with a compiled .so, we can't relink it. Is there anyway of turning the .so into a static archive and relink it or even rewriting the link table to redirect these calls to our wraps?
Outside of disassembling, changing the library, and reassembling I can't think of any way to do this easily.