From: Nicholas Nethercote Date: Sat, 14 May 2005 17:11:06 +0000 (+0000) Subject: Move resolve_redir_allsegs() to vg_redir.c, the only file that uses it, X-Git-Tag: svn/VALGRIND_3_0_0~611 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa4560de8a3048fde5acb476543a69b81fd10927;p=thirdparty%2Fvalgrind.git Move resolve_redir_allsegs() to vg_redir.c, the only file that uses it, and make it private. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3707 --- diff --git a/coregrind/core.h b/coregrind/core.h index 48aa00658c..29498ffd73 100644 --- a/coregrind/core.h +++ b/coregrind/core.h @@ -649,8 +649,6 @@ extern Bool VG_(get_fnname_nodemangle)( Addr a, Char* fnname, Int n_fnname ); extern Addr VG_(reverse_search_one_symtab) ( const SegInfo* si, const Char* name ); -extern Bool VG_(resolve_redir_allsegs)(CodeRedirect *redir); - extern Bool VG_(use_CFI_info) ( /*MOD*/Addr* ipP, /*MOD*/Addr* spP, /*MOD*/Addr* fpP, diff --git a/coregrind/vg_redir.c b/coregrind/vg_redir.c index f0840b7f09..1d6c332553 100644 --- a/coregrind/vg_redir.c +++ b/coregrind/vg_redir.c @@ -265,6 +265,20 @@ Bool VG_(resolve_redir)(CodeRedirect *redir, const SegInfo *si) return resolved; } +static Bool resolve_redir_allsegs(CodeRedirect *redir) +{ + const SegInfo *si; + + for(si = VG_(next_seginfo)(NULL); + si != NULL; + si = VG_(next_seginfo)(si)) + { + if (VG_(resolve_redir)(redir, si)) + return True; + } + return False; +} + /* Go through the complete redir list, resolving as much as possible with this SegInfo. This should be called when a new SegInfo symtab is loaded. @@ -314,7 +328,7 @@ static void add_redirect_sym_to_sym(const Char *from_lib, const Char *from_sym, /* Check against all existing segments to see if this redirection can be resolved immediately */ - if (!VG_(resolve_redir_allsegs)(redir)) { + if (!resolve_redir_allsegs(redir)) { /* nope, add to list */ redir->next = unresolved_redir; unresolved_redir = redir; @@ -344,7 +358,7 @@ void VG_(add_redirect_sym_to_addr)(const Char *from_lib, const Char *from_sym, /* Check against all existing segments to see if this redirection can be resolved immediately */ - if (!VG_(resolve_redir_allsegs)(redir)) { + if (!resolve_redir_allsegs(redir)) { /* nope, add to list */ redir->next = unresolved_redir; unresolved_redir = redir; @@ -397,7 +411,7 @@ CodeRedirect *VG_(add_wrapper)(const Char *from_lib, const Char *from_sym, /* Check against all existing segments to see if this redirection can be resolved immediately */ - if (!VG_(resolve_redir_allsegs)(redir)) { + if (!resolve_redir_allsegs(redir)) { /* nope, add to list */ redir->next = unresolved_redir; unresolved_redir = redir; diff --git a/coregrind/vg_symtab2.c b/coregrind/vg_symtab2.c index b49f9b2ca4..45d7bb42e0 100644 --- a/coregrind/vg_symtab2.c +++ b/coregrind/vg_symtab2.c @@ -1058,17 +1058,6 @@ void handle_intercept( SegInfo* si, Char* symbol, ElfXX_Sym* sym) VG_(arena_free)(VG_AR_SYMTAB, lib); } -Bool VG_(resolve_redir_allsegs)(CodeRedirect *redir) -{ - SegInfo *si; - - for(si = segInfo; si != NULL; si = si->next) - if (VG_(resolve_redir)(redir, si)) - return True; - - return False; -} - //static //void handle_wrapper( SegInfo* si, Char* symbol, ElfXX_Sym* sym) //{