Written by
Bernardo
on
on
ELF library loading
TIL about the algorithm an interpreter uses in order to load libraries in which your ELF file depends on:
The interpreter locates the libraries in this order:
LD_PRELOAD
environment variable, and anything in /etc/ld.so.preloadLD_LIBRARY_PATH
environment variableDT_RUNPATH
orDT_RPATH
specified in the binary file (both can be modified with patchelf)- system-wide configuration (/etc/ld.so.conf)
/lib
and/usr/lib