Dynamic Linking Infographic

What happens when your code calls printf()? And what’s up with all that .got.plt crap that you see when you decompile a binary? Here are some sketches I drew to help me remember this kind of stuff.

Full Infographic.

These sketches are mainly inspired by How the ELF ruined the Christmas.

Intro: Dynamic Linking

First of all, we need to understand the difference between a statically linked binary and a dynamically linked one:

Dynamically linked binaries have a bunch of information that is used to link them together:

Lazy Loading

The procedure of jumping to the library function and finding the appropriate address is described below:

Bonus: Linking Flags

Some flags can be specified to avoid the “lazy” part of dynamic loading.