about summary refs log tree commit diff
path: root/elf/dl-load.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/dl-load.c')
-rw-r--r--elf/dl-load.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 48e7cba235..2be2083408 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1225,6 +1225,13 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
   l->l_dev = st.st_dev;
   l->l_ino = st.st_ino;
 
+  /* When we profile the SONAME might be needed for something else but
+     loading.  Add it right away.  */
+  if (__builtin_expect (GL(dl_profile) != NULL, 0)
+      && l->l_info[DT_SONAME] != NULL)
+    add_name_to_object (l, ((const char *) D_PTR (l, l_info[DT_STRTAB])
+			    + l->l_info[DT_SONAME]->d_un.d_val));
+
   return l;
 }