Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is LD_RUNPATH?

A couple of answers mention the LD_RUNPATH environment variable:

  • use RPATH but not RUNPATH?
  • How to blacklist a shared library to avoid it being fetched by the loader?

but I couldn't find any description or official reference, including in the ld(1) and ld.so(8) Linux man pages. It seems that the goal is to have a lower precedence than LD_LIBRARY_PATH, particularly useful under Solaris, where LD_LIBRARY_PATH overrides everything.

A search on Google shows some discussions involving LD_RUNPATH, but nothing concrete. A search on Wikipedia is also unsuccessful. I also did some compilation/run tests with shared libraries under GNU/Linux and Solaris, but couldn't notice any effect.

So, what is this environment variable? Is there any official documentation?

like image 268
vinc17 Avatar asked Apr 13 '26 21:04

vinc17


1 Answers

There is no LD_RUNPATH. Most likely this is a typo of LD_RUN_PATH or DT_RUNPATH.

Regarding DT_RUNPATH, TechBlog says:

The DT_RUNPATH value is set with the linker options -rpath (or LD_RUN_PATH) and the –enable-new-dtags.

like image 113
Armali Avatar answered Apr 16 '26 14:04

Armali



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!