There's a hint in the dlopen docs about how it might be achieved:
dlopen()
...
o (ELF only) If the executable file for the calling program contains
a DT_RPATH tag, and does not contain a DT_RUNPATH tag, then the directories listed in the DT_RPATH tag are searched.
There's a hint in the dlopen docs about how it might be achieved:
dlopen()
directories listed in the DT_RPATH tag are searched.
...
o (ELF only) If the executable file for the calling program contains
a DT_RPATH tag, and does not contain a DT_RUNPATH tag, then the