Home

DTRUNPATH

DTRUNPATH is the runtime path tag used by the ELF dynamic linker to locate shared libraries. In ELF binaries, it corresponds to the DT_RUNPATH entry in the dynamic section, and it specifies directories to be searched for dependencies at program startup and during dynamic loading.

Purpose and behavior: DTRUNPATH directs the linker to search the listed directories for needed libraries. Compared

Setting DTRUNPATH: Most linkers provide options to embed a runpath into the resulting binary, for example by

Platform notes: DTRUNPATH is specific to ELF-based systems such as Linux and many BSD variants; macOS uses

See also: DT_RUNPATH, DT_RPATH, LD_LIBRARY_PATH, dynamic linker, ELF, shared libraries.

with
DT_RPATH,
RUNPATH
is
designed
to
cooperate
with
the
LD_LIBRARY_PATH
environment
variable,
allowing
runtime
paths
to
be
augmented
by
user-supplied
paths.
If
both
are
present,
RUNPATH
is
consulted
in
a
way
that
permits
LD_LIBRARY_PATH
to
influence
the
effective
search
path.
using
linker
flags
to
specify
runpath
directories
at
link
time.
This
approach
promotes
relocatability
of
binaries
and
packages
where
libraries
are
installed
in
non-default
locations,
helping
to
ensure
that
dependencies
can
be
found
without
requiring
system-wide
changes.
a
different
mechanism
for
locating
libraries
and
does
not
use
DT_RUNPATH.
In
practice,
the
presence
of
a
runpath
can
aid
packaging
tools
and
distribution
maintainers
by
making
binaries
more
self-contained
with
respect
to
their
library
dependencies.