From 830171cbd16c9bcf32f3b84268b1d216076683b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vivek=20Das=C2=A0Mohapatra?= <vivek@collabora.co.uk> Date: Fri, 19 May 2017 20:08:57 +0100 Subject: [PATCH] Dont walk the link map in both directions: just rewind it first. --- capsule/capsule-dlmopen.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/capsule/capsule-dlmopen.c b/capsule/capsule-dlmopen.c index 8beed7ff9..7439a442a 100644 --- a/capsule/capsule-dlmopen.c +++ b/capsule/capsule-dlmopen.c @@ -1327,11 +1327,8 @@ static int install_wrappers ( void *dl_handle, map ? map->l_prev : NULL ); // no guarantee that we're at either end of the link map: - // walk it in both directions. - if (map->l_prev) - for( struct link_map *m = map; m; m = m->l_prev ) - if( !excluded_from_wrap(m->l_name, (char **)exclude) ) - wrap( m->l_name, m->l_addr, m->l_ld, wrappers ); + while( map->l_prev ) + map = map->l_prev; if (map->l_next) for( struct link_map *m = map; m; m = m->l_next ) -- GitLab