3 ms·
LD_PRELOAD strikes again! I learned about LD_PRELOAD last year from another HN post, and I'm not saying it's a silver bullet for instrumenting binaries on Linu
by alasarmas 6y ago
LD_PRELOAD strikes again! I learned about LD_PRELOAD last year from another HN post, and I'm not saying it's a silver bullet for instrumenting binaries on Linux, but it does seem to come in handy.
Edit: a SO question about "the LD_PRELOAD trick":
https://stackoverflow.com/questions/426230/what-is-the-ld-preload-trick https://stackoverflow.com/questions/426230/what-is-the-ld-pr...
- gnufx 6y agoLD_PRELOAD is the normal way to add instrumentation on ELF HPC; it's more-or-less assumed by the MPI profiling facility. I'm surprised that LD_PRELOAD should be news to anyone at this stage, though. For instance, glibc has hooks for interposing that way, like a different malloc. It's definitely not general, specifically not for static binaries (Cray?). Dyninst is the usual alternative.