102.3 Manage Shared Libraries (Overview) Flashcards
Shared Libraries
reusable functions that other apps use by ‘linking’ to them within the library file
shared libraries
Shared Libraries
shared libraries have the file extension
.so
shared object
Shared Libraries
/lib
/usr/lib*
/usr/local/lib/*
/usr/share/*
common locations for shared libraries
Shared Libraries
specific library versions linked to more generic name
soft links
ie: libstdc++.so > libstdc++.so>6.).19
Shared libraries : Linking
app contains full copy of library used
static linking
Shared libraries : Linking
Advantage of static linking
version control
app has exact library version it expects with known interfaces
Shared libraries : Linking
Disadvantage of static linking
size
increases the size of the app since it includes full copy of any statically linked library
Shared libraries : Linking
Disadvantage of static linking
upgrades
app needs to be recompiled and relinked anytime the library required is updated
Shared libraries : Linking
app uses the library externally using ‘______” library that is installed on the OS itself but not the app
‘stubs’
Shared libraries : Linking
Advantage of dynamic linking
size
app is smaller because the libs are separate from it
Shared libraries : Linking
Advantage of dynamic linking
upgrades
no recompile or relinking needed
Shared Libraries: Linking
any time an app needs to use a shared library this service is called
ld.so
aka dynamic linker
Shared Libraries: Linking
shows a list of all libs the indicated dynamic executable app requries
ldd [filename]
Shared Libraries: Linking
configures dynamic linker run-time bindings (creates links / caches most recent)
ldconfig
Shared Libraries: linking
ldconfig
looks as specified on command line
looks as specified in the
commonly run after system updates or after 3rd party app installs
ls.so.conf file