Code instrumentation with LD_PRELOAD

Author: Jan Smout

Ever built a binary that showed wrong behaviour that you couldn't pinpoint despite various testing, logging, and tracing? Ever had to deal with a 3rd party binary library (without source) that needed a bit of tweaking? Have you never experienced these issues, but are you afraid that you might do so in the future?

No need to worry on an average Linux system, as it has the necessary tools available to tackle these problems. The dynamic linker/loader ( has the capability to instrument your application. All you have to do is write your instrumentation code, put it in a shared library and restart your application using LD_PRELOAD.

Jan Smout explains how the dynamic linker/loader is involved, where LD_PRELOAD fits into this picture and shows which pitfalls to avoid. He will guide you through the possibilities with real-life examples. Visit this presentation to learn how to effectively use this mechanism for your benefit!