Wanted to know in detail about how shared libraries work vis-a-vis static library.

Posted by goldenmean on Stack Overflow See other posts from Stack Overflow or by goldenmean
Published on 2009-04-23T09:19:16Z Indexed on 2010/03/29 5:03 UTC
Read the original article Hit count: 380

Filed under:
|
|

Hello,

I am working on creating and linking shared library (.so). While working with them, many questions popped up which i could not find satisying answers when i searched for them, hence putting them here. The questions about shared libraries i have are:

1.) How is shared library different than static library? What are the Key differences in way they are created, they execute?

2.) In case of a shared library at what point are the addresses where a particular function in shared library will be loaded and run from, given? Who gives those functions is load/run addresses?

3.) Will an application linked against shared library be slower in execution as compared to that which is linked with a static library?

4.) Will application executable size differ in these two cases?

5.) Can one do source level debugging of by stepping into functions defined inside a shared library? Is any thing extra needed to make these functions visible to the application?

6.) What are pros and cons in using either kind of library?

Thanks.

-AD

© Stack Overflow or respective owner

Related posts about shared

Related posts about library