Skip to content

Commit

Permalink
* elf/dl-load.c (_dl_init_paths): Expand DSTs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrich Drepper committed Aug 29, 2006
1 parent 4004a0a commit 950398e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
2006-08-28 Ulrich Drepper <drepper@redhat.com>

* elf/dl-load.c (_dl_init_paths): Expand DSTs.

* elf/dl-open.c (dl_open_worker): Allow $LIB and $PLATFORM in
dlopen parameters.

Expand Down
20 changes: 19 additions & 1 deletion elf/dl-load.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit 950398e

Please sign in to comment.