Now i have 3 shared objects,A.so,B.so,C.so
A.c
void libA()
{
common();
}
B.c
void common()
{
printf("COME HERE B\n");
}
C.c
void common()
{
printf("COME HERE C\n");
}
(just ingore the .h files)
test.c
int main()
{
libA();
return 1;
}
complie:
gcc -fPIC -shared libB.so libB.c
gcc -fPIC -shared libA.so libA.c ./libB.so
gcc -o test test.c libC.so libA.so
I wish result to be "COME HERE B" and i could use dlopen
with RTLD_DEEPBIND
flag,
but it costs too much time to change functions from implicit call to explicit call in my project.
Is there anyway to solve this problem?
gcc -Wl,-Bsymbolic
doesn't work in this solution.
Well, if A.c contains implementation of common. It does work.