Alexandre Julliard : preloader: Fixed type checking in symbol lookup.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jul 31 15:01:21 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 51d84822228322e71b300862ee28947384d9abfb
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=51d84822228322e71b300862ee28947384d9abfb

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Jul 31 16:44:40 2006 +0200

preloader: Fixed type checking in symbol lookup.

---

 loader/preloader.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/loader/preloader.c b/loader/preloader.c
index d372ed7..52f4cc1 100644
--- a/loader/preloader.c
+++ b/loader/preloader.c
@@ -761,7 +761,7 @@ static unsigned int elf_hash( const char
 /*
  * Find a symbol in the symbol table of the executable loaded
  */
-static void *find_symbol( const ElfW(Phdr) *phdr, int num, const char *var )
+static void *find_symbol( const ElfW(Phdr) *phdr, int num, const char *var, int type )
 {
     const ElfW(Dyn) *dyn = NULL;
     const ElfW(Phdr) *ph;
@@ -817,7 +817,7 @@ #endif
 
         while (idx != STN_UNDEF)
         {
-            if( ( ELF32_ST_BIND(symtab[idx].st_info) == STT_OBJECT ) &&
+            if (symtab[idx].st_info == ELF32_ST_INFO( STB_GLOBAL, type ) &&
                 !wld_strcmp( strings + symtab[idx].st_name, var ))
             {
 #ifdef DUMP_SYMS
@@ -991,7 +991,7 @@ #endif
 
     /* store pointer to the preload info into the appropriate main binary variable */
     wine_main_preload_info = find_symbol( main_binary_map.l_phdr, main_binary_map.l_phnum,
-                                          "wine_main_preload_info" );
+                                          "wine_main_preload_info", STT_OBJECT );
     if (wine_main_preload_info) *wine_main_preload_info = preload_info;
     else wld_printf( "wine_main_preload_info not found\n" );
 




More information about the wine-cvs mailing list