about summary refs log tree commit diff
path: root/elf/dl-addr.c
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@redhat.com>2013-02-18 18:00:17 +0530
committerSiddhesh Poyarekar <siddhesh@redhat.com>2013-02-18 18:00:17 +0530
commitbe179c8a36fc171acff0634ac50ad31269ad4742 (patch)
tree39519d73882acb6fc3f3de4227e884e8a472abd9 /elf/dl-addr.c
parent8313cb997d2da2465c8560d3164358a68ea1e9ad (diff)
downloadglibc-be179c8a36fc171acff0634ac50ad31269ad4742.tar.gz
glibc-be179c8a36fc171acff0634ac50ad31269ad4742.tar.xz
glibc-be179c8a36fc171acff0634ac50ad31269ad4742.zip
New function _dl_find_dso_for_object
Consolidate code to search for an address within a DSO.
Diffstat (limited to 'elf/dl-addr.c')
-rw-r--r--elf/dl-addr.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/elf/dl-addr.c b/elf/dl-addr.c
index 91cc443439..a53346627f 100644
--- a/elf/dl-addr.c
+++ b/elf/dl-addr.c
@@ -130,18 +130,14 @@ _dl_addr (const void *address, Dl_info *info,
   /* Protect against concurrent loads and unloads.  */
   __rtld_lock_lock_recursive (GL(dl_load_lock));
 
-  /* Find the highest-addressed object that ADDRESS is not below.  */
-  for (Lmid_t ns = 0; ns < GL(dl_nns); ++ns)
-    for (struct link_map *l = GL(dl_ns)[ns]._ns_loaded; l; l = l->l_next)
-      if (addr >= l->l_map_start && addr < l->l_map_end
-	  && (l->l_contiguous || _dl_addr_inside_object (l, addr)))
-	{
-	  determine_info (addr, l, info, mapp, symbolp);
-	  result = 1;
-	  goto out;
-	}
+  struct link_map *l = _dl_find_dso_for_object (addr);
+
+  if (l)
+    {
+      determine_info (addr, l, info, mapp, symbolp);
+      result = 1;
+    }
 
- out:
   __rtld_lock_unlock_recursive (GL(dl_load_lock));
 
   return result;