From be179c8a36fc171acff0634ac50ad31269ad4742 Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Mon, 18 Feb 2013 18:00:17 +0530 Subject: New function _dl_find_dso_for_object Consolidate code to search for an address within a DSO. --- elf/dl-addr.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'elf/dl-addr.c') 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; -- cgit 1.4.1