Alexandre Julliard : loader: Avoid ELF32_ST_INFO macro that is missing on Android.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Jul 24 14:52:43 CDT 2014


Module: wine
Branch: master
Commit: 8b4ed00b59397c4d8658ff588c058feaa233e0c8
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8b4ed00b59397c4d8658ff588c058feaa233e0c8

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Jul 24 20:34:39 2014 +0200

loader: Avoid ELF32_ST_INFO macro that is missing on Android.

---

 loader/preloader.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/loader/preloader.c b/loader/preloader.c
index f38e17a..25aaacd 100644
--- a/loader/preloader.c
+++ b/loader/preloader.c
@@ -999,7 +999,8 @@ static void *find_symbol( const ElfW(Phdr) *phdr, int num, const char *var, int
         do
         {
             if ((chains[idx] & ~1u) == (hash & ~1u) &&
-                symtab[idx].st_info == ELF32_ST_INFO( STB_GLOBAL, type ) &&
+                ELF32_ST_BIND(symtab[idx].st_info) == STB_GLOBAL &&
+                ELF32_ST_TYPE(symtab[idx].st_info) == type &&
                 !wld_strcmp( strings + symtab[idx].st_name, var ))
                 goto found;
         } while (!(chains[idx++] & 1u));
@@ -1011,9 +1012,10 @@ static void *find_symbol( const ElfW(Phdr) *phdr, int num, const char *var, int
         const Elf32_Word *buckets = hashtab + 2;
         const Elf32_Word *chains  = buckets + nbuckets;
 
-        for (idx = buckets[hash % nbuckets]; idx != STN_UNDEF; idx = chains[idx])
+        for (idx = buckets[hash % nbuckets]; idx; idx = chains[idx])
         {
-            if (symtab[idx].st_info == ELF32_ST_INFO( STB_GLOBAL, type ) &&
+            if (ELF32_ST_BIND(symtab[idx].st_info) == STB_GLOBAL &&
+                ELF32_ST_TYPE(symtab[idx].st_info) == type &&
                 !wld_strcmp( strings + symtab[idx].st_name, var ))
                 goto found;
         }




More information about the wine-cvs mailing list