Table of Contents

Rx-lib (working title)

Overview

I had an idea while thinking about libraries: why not look into seeing if we can create some functionality that allows a-la carte access to necessary functions. If you like against libm and ONLY use pow(), do you really need to bring everything else along with it?

Obviously the only way to find out is to explore it. Thusly this page was created.

Background

In UNIX, there are generally 2 types of libraries: static and shared

Static libraries are archives of .o files, packaged by the ar command, stored on the system typically with a “.a” extension. When you link against static libraries, all the code in the library is included in the final executable. This means larger executables and more resources used, but a guarantee that everything you need is there.

Shared libraries are different. The compiler can produce them, and they include more run-time dynamic linking capabilities. All the code is there, but is not as directly accessible (I've yet to find a way to directly extract the individual .o files… they appear to be all blended together; there are some interesting strategies suggested for arriving at the desired solution, however). When compiled, the executable has a dependency on the various libraries… during run-time, the symbols/object code in those libraries are included in the executable. This results in smaller executables, and more points of failure (if something happens to the shared object library, it could break a bunch of stuff). Shared object files typically have a “.so” extension.

Resources

I found the following resources quite informative: