Skip to content

ld-libs: Parse and use DT_RUNPATH to find dependencies

Simon McVittie requested to merge wip/smcv/runpath into master
  • ld-libs: Correct some comments

  • ld-libs: Parse and use DT_RUNPATH to find dependencies

    Some non-FHS operating systems like NixOS are heavily reliant on DT_RUNPATH.

    Unlike the old DT_RPATH, DT_RUNPATH is relatively simple to implement: if an object libdependent depends on another object libdependency, only the DT_RUNPATH of libdependent is used to search for libdependency (the DT_RUNPATHs of "larger" libraries or the executable are ignored).

    DT_RPATH is not implemented here, because it's more difficult: we would have to do what ld.so does, which is to build up a stack with the object that loaded the object that loaded (etc.) the object that loaded the one we are currently considering, and walk all the way up the stack looking for RPATHs.

    Helps: https://github.com/ValveSoftware/steam-runtime/issues/511

/cc @denittis @vivek

Edited by Simon McVittie

Merge request reports