5

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

linuxbuild
  • 15,843
  • 6
  • 60
  • 87
goldenmean
  • 18,376
  • 54
  • 154
  • 211

1 Answers1

1

See this SO question When to use dynamic vs. static libraries and this HOWTO.

Community
  • 1
  • 1