summaryrefslogtreecommitdiff
path: root/elf/dl-load.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2006-08-31 06:53:32 +0000
committerJakub Jelinek <jakub@redhat.com>2006-08-31 06:53:32 +0000
commit936bb2647a835e63e99fa2d1590ab1e14aab4712 (patch)
treee0fcf856a8a2051f8878dd4c8eca215bc549de13 /elf/dl-load.c
parent2455d11258712bbab8a52c7951301924a483a295 (diff)
Updated to fedora-glibc-20060831T0640cvs/fedora-glibc-2_4_90-27
Diffstat (limited to 'elf/dl-load.c')
-rw-r--r--elf/dl-load.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 902ffc4109..36dc123c01 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -749,7 +749,25 @@ _dl_init_paths (const char *llp)
{
size_t nllp;
const char *cp = llp;
- char *llp_tmp = strdupa (llp);
+ char *llp_tmp;
+
+#ifdef SHARED
+ /* Expand DSTs. */
+ size_t cnt = DL_DST_COUNT (llp, 1);
+ if (__builtin_expect (cnt == 0, 1))
+ llp_tmp = strdupa (llp);
+ else
+ {
+ /* Determine the length of the substituted string. */
+ size_t total = DL_DST_REQUIRED (l, llp, strlen (llp), cnt);
+
+ /* Allocate the necessary memory. */
+ llp_tmp = (char *) alloca (total + 1);
+ llp_tmp = _dl_dst_substitute (l, llp, llp_tmp, 1);
+ }
+#else
+ llp_tmp = strdupa (llp);
+#endif
/* Decompose the LD_LIBRARY_PATH contents. First determine how many
elements it has. */