Skip to main content
IBM  
Shop Support Downloads
IBM Home Products Consulting Industries News About IBM
IBM developerWorks : Linux : Education - Tutorials
LPI certification 102 exam prep, Part 1
ZIPPDF (letter)PDF (A4)e-mail
Main menuSection menuFeedbackPreviousNext
2. Shared libraries
  


Static vs. dynamic executables page 2 of 8


We can use the ldd command to determine if a particular executable program is static:


# ldd /sbin/sln
        not a dynamic executable

"not a dynamic executable" is ldd's way of saying that sln is statically linked. Now, let's take a look at sln's size in comparison to its non-static cousin, ln:


# ls -l /bin/ln /sbin/sln
-rwxr-xr-x    1 root     root        23000 Jan 14 00:36 /bin/ln
-rwxr-xr-x    1 root     root       381072 Jan 14 00:31 /sbin/sln

As you can see, sln is over ten times the size of ln. ln is so much smaller than sln because it is a dynamic executable. Dynamic executables are incomplete programs that depend on external shared libraries to provide many of the functions that they need to run.


Main menuSection menuFeedbackPreviousNext
Privacy Legal Contact