correct fn defn

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi folks,

I wanted to know what happens in gcc in the following scenario.

Say, there is a function by the name jellyfish() defined in libc6.so
Now I compile a binary(say bigben) which also contains jellyfish() defined.

This binary(bigben) of mine has the capability to load a .so at run time..

Now I create a bridge.so which uses jellyfish(), but during compile
time, I link it to another static library(say libpapa.a) which defines
jellyfish(), and if I do an nm on the module, I can see that
jellyfish() is defined in it.

Now I presume that at runtime when bride.so calls jellyfish after
being loaded to bigben, it should actually use the definition which is
present in libpapa.a.

But I see that tracing the code using a debugger shows that it is
actually using the definition from libc6.so.

How can I prevent this from happening and actually ensure that
jellyfish definition is picked up from libpapa.a and neither from
bigben or from libc6.so.

Thanks
Ryan.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux