|
|
Subscribe / Log in / New account

I used to do tons with LD_PRELOAD

I used to do tons with LD_PRELOAD

Posted Feb 13, 2024 20:53 UTC (Tue) by davecb (subscriber, #1574)
Parent article: A look at dynamic linking

In a previous life, interposing things between caller and recipient was a favourite task.
We used it to create programs like a low-overhead strace, a performance measurement tool that used unmodified binaries, and, as a demo, a Linux library profiler, https://github.com/davecb/libprof


to post comments

I used to do tons with LD_PRELOAD

Posted Feb 21, 2024 12:22 UTC (Wed) by nix (subscriber, #2304) [Link]

Nowadays, if you want to do something like that and also explore exciting underused parts of ld.so, the thing to try is LD_AUDIT libraries. These are loaded in a new dlmopen namespace, so they can rely on other shared libraries and the like, making it a lot easier to write the things than it is to write an LD_PRELOADed profiler.

(In practice this excellent feature is rarely used, alas.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds