[PATCH] ld.so - add environment placeholders

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Discussion is here[1].

Apparently there is a hidden feature in ld.so, it support variable
placeholders within environment.

This is great for supporting mixed multilib environment.

Example:

export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/my/\${LIB}"

I believe this worth a documentation, as almost nobody knows this.

---
 ENVIRONMENT
+       ld.so understands the strings $ORIGIN, $LIB and $PLATFORM  (or  equiva‐
+       lently   ${var})   in  some  of  the  environment  variables,  such  as
+       LD_LIBRARY_PATH and LD_PRELOAD:
+
+              ORIGIN is expanded to the location of the binary which  is  cur‐
+              rently loaded.
+
+              LIB  is  expanded to lib, lib64 or any other multilib configura‐
+              tion based on the ld configuration.  Use when mixed  environment
+              (32bit and 64bit) searches for same libraries names.
+
+              PLATFORM is expanded to the running platform.

        There are four important environment variables.
---

Any test will do! as long as this feature gets documented.

Signed-off-by: Alon Bar-Lev <alon.barlev@xxxxxxxxx>

[1] http://sourceware.org/ml/libc-alpha/2011-08/msg00089.html

---

[Attached]
I am not subscribed, so please CC me.

Attachment: man-pages-master-ld.so.8-vars.diff
Description: plain/text


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux