Ubuntu Pastebin

Paste from rsalveti at Tue, 7 Apr 2015 19:33:08 +0000

Download as text
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
rsalveti@evasys:/tmp/lib$ diff -Naur libhybris-0.1.0+git20131207+e452e83-38 libhybris-0.1.0+git20131207+e452e83-39
diff -Naur libhybris-0.1.0+git20131207+e452e83-38/hybris/common/jb/dlfcn.c libhybris-0.1.0+git20131207+e452e83-39/hybris/common/jb/dlfcn.c
--- libhybris-0.1.0+git20131207+e452e83-38/hybris/common/jb/dlfcn.c	2015-04-07 16:31:38.000000000 -0300
+++ libhybris-0.1.0+git20131207+e452e83-39/hybris/common/jb/dlfcn.c	2015-04-07 16:32:10.000000000 -0300
@@ -165,11 +165,13 @@
     return 0;
 }
 
+int android_dl_iterate_phdr(int (*cb)(struct dl_phdr_info *info, size_t size, void *data),void *data);
+
 #if defined(ANDROID_ARM_LINKER)
 //                     0000000 00011111 111112 22222222 2333333 333344444444445555555
 //                     0123456 78901234 567890 12345678 9012345 678901234567890123456
 #define ANDROID_LIBDL_STRTAB \
-                      "dlopen\0dlclose\0dlsym\0dlerror\0dladdr\0dl_unwind_find_exidx\0"
+                      "dlopen\0dlclose\0dlsym\0dlerror\0dladdr\0dl_iterate_phdr\0dl_unwind_find_exidx\0"
 
 _Unwind_Ptr android_dl_unwind_find_exidx(_Unwind_Ptr pc, int *pcount);
 
@@ -179,8 +181,6 @@
 #define ANDROID_LIBDL_STRTAB \
                       "dlopen\0dlclose\0dlsym\0dlerror\0dladdr\0dl_iterate_phdr\0"
 
-int android_dl_iterate_phdr(int (*cb)(struct dl_phdr_info *info, size_t size, void *data),void *data);
-
 #elif defined(ANDROID_SH_LINKER)
 //                     0000000 00011111 111112 22222222 2333333 3333444444444455
 //                     0123456 78901234 567890 12345678 9012345 6789012345678901
@@ -224,21 +224,14 @@
       st_info: STB_GLOBAL << 4,
       st_shndx: 1,
     },
-#ifdef ANDROID_ARM_LINKER
-    { st_name: 36,
-      st_value: (Elf_Addr) &android_dl_unwind_find_exidx,
-      st_info: STB_GLOBAL << 4,
-      st_shndx: 1,
-    },
-#elif defined(ANDROID_X86_LINKER)
     { st_name: 36,
       st_value: (Elf_Addr) &android_dl_iterate_phdr,
       st_info: STB_GLOBAL << 4,
       st_shndx: 1,
     },
-#elif defined(ANDROID_SH_LINKER)
-    { st_name: 36,
-      st_value: (Elf_Addr) &android_dl_iterate_phdr,
+#ifdef ANDROID_ARM_LINKER
+    { st_name: 52,
+      st_value: (Elf_Addr) &android_dl_unwind_find_exidx,
       st_info: STB_GLOBAL << 4,
       st_shndx: 1,
     },
@@ -265,7 +258,11 @@
  * stubbing them out in libdl.
  */
 static unsigned libdl_buckets[1] = { 1 };
+#ifdef ANDROID_ARM_LINKER
+static unsigned libdl_chains[8] = { 0, 2, 3, 4, 5, 6, 7, 0 };
+#else
 static unsigned libdl_chains[7] = { 0, 2, 3, 4, 5, 6, 0 };
+#endif
 
 soinfo libdl_info = {
     name: "libdl.so",
@@ -274,8 +271,8 @@
     strtab: ANDROID_LIBDL_STRTAB,
     symtab: libdl_symtab,
 
-    nbucket: 1,
-    nchain: 7,
+    nbucket: sizeof(libdl_buckets)/sizeof(unsigned),
+    nchain: sizeof(libdl_chains)/sizeof(unsigned),
     bucket: libdl_buckets,
     chain: libdl_chains,
 };
diff -Naur libhybris-0.1.0+git20131207+e452e83-38/hybris/common/jb/linker.c libhybris-0.1.0+git20131207+e452e83-39/hybris/common/jb/linker.c
--- libhybris-0.1.0+git20131207+e452e83-38/hybris/common/jb/linker.c	2015-04-07 16:31:38.000000000 -0300
+++ libhybris-0.1.0+git20131207+e452e83-39/hybris/common/jb/linker.c	2015-04-07 16:32:10.000000000 -0300
@@ -357,7 +357,8 @@
    *pcount = 0;
     return NULL;
 }
-#elif defined(ANDROID_X86_LINKER)
+#endif
+
 /* Here, we only have to provide a callback to iterate across all the
  * loaded libraries. gcc_eh does the rest. */
 int
@@ -379,7 +380,6 @@
     }
     return rv;
 }
-#endif
 
 static Elf_Sym *_elf_lookup(soinfo *si, unsigned hash, const char *name)
 {
diff -Naur libhybris-0.1.0+git20131207+e452e83-38/hybris/common/jb/linker.h libhybris-0.1.0+git20131207+e452e83-39/hybris/common/jb/linker.h
--- libhybris-0.1.0+git20131207+e452e83-38/hybris/common/jb/linker.h	2015-04-07 16:31:38.000000000 -0300
+++ libhybris-0.1.0+git20131207+e452e83-39/hybris/common/jb/linker.h	2015-04-07 16:32:10.000000000 -0300
@@ -229,11 +229,10 @@
 const char *linker_get_error(void);
 void call_constructors_recursive(soinfo *si);
 
+int dl_iterate_phdr(int (*cb)(struct dl_phdr_info *, size_t, void *), void *);
 #ifdef ANDROID_ARM_LINKER 
 typedef long unsigned int *_Unwind_Ptr;
 _Unwind_Ptr dl_unwind_find_exidx(_Unwind_Ptr pc, int *pcount);
-#elif defined(ANDROID_X86_LINKER)
-int dl_iterate_phdr(int (*cb)(struct dl_phdr_info *, size_t, void *), void *);
 #endif
 
 #endif
Download as text