diff options
author | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2015-02-08 15:06:11 +0100 |
---|---|---|
committer | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2015-02-08 15:06:11 +0100 |
commit | 9728de1929812df84749c9fb044f6f584e044199 (patch) | |
tree | 947f8e9e2215619e7edad0491db894fe4cecf614 /ldso | |
parent | ff6ce3999db93a52d1cd22510f8508b660ddf54e (diff) |
Use executables RPATH/RUNPATH when searching for libraries.
Patch by Steve Ellcey <sellcey@imgtec.com> on uClibc mailinglist.
Diffstat (limited to 'ldso')
-rw-r--r-- | ldso/ldso/dl-elf.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c index 6fc95b300..d42b91281 100644 --- a/ldso/ldso/dl-elf.c +++ b/ldso/ldso/dl-elf.c @@ -266,6 +266,18 @@ struct elf_resolve *_dl_load_shared_library(unsigned rflags, struct dyn_elf **rp if ((tpnt1 = search_for_named_library(libname, rflags, pnt, rpnt, NULL)) != NULL) return tpnt1; } +#ifdef __LDSO_RUNPATH_OF_EXECUTABLE__ + /* + * Try the DT_RPATH of the executable itself. + */ + pnt = (char *) _dl_loaded_modules->dynamic_info[DT_RPATH]; + if (pnt) { + pnt += (unsigned long) _dl_loaded_modules->dynamic_info[DT_STRTAB]; + _dl_if_debug_dprint("\tsearching exe's RPATH='%s'\n", pnt); + if ((tpnt1 = search_for_named_library(libname, rflags, pnt, rpnt)) != NULL) + return tpnt1; + } +#endif #endif /* |