Let's say one of your libraries contains a function called foo().
Then create a simple wrapper function which just calls foo, say
Code:
// wrap_foo.c
int wrap_foo ( int a, double b ) {
return foo ( a, b );
}
Start with say
ar x libfoo.a
To extract all the individual object files from the library.
Then you would do something like
gcc -c wrap_foo.c
echo wrap_foo > keepsyms.txt
ld -r -o wrapped_foo.o --retain-symbols-file keepsyms.txt wrap_foo.o foo.o
Which
- compiles the wrapper
- links the wrapper to the existing function, and removes the unwanted symbols.
You can then add the new objects back into a library you can link against.
If the library functions have the same names, I'm guessing they have the same interfaces as well? This could give you some scope with automating this task.
http://sourceware.org/binutils/docs-...s.html#Options