about summary refs log tree commit diff
path: root/elf/dl-open.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/dl-open.c')
-rw-r--r--elf/dl-open.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/elf/dl-open.c b/elf/dl-open.c
index 373d32dd79..8171837236 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -32,6 +32,13 @@ _dl_open (struct link_map *parent, const char *file, int mode)
   struct r_debug *r;
 
 
+#ifdef PIC
+  if (! parent)
+    /* If no particular dependent object caused this load,
+       then use the DT_RPATH of the executable itself.  */
+      parent = _dl_loaded;
+#endif
+
   /* Load the named object.  */
   new = _dl_map_object (parent, file, lt_loaded);
   if (new->l_searchlist)