this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Apply Darling fixes to _libkernel_init

+18 -1
+17 -1
src/kernel/libsyscall/wrappers/_libkernel_init.c
··· 31 31 #include <strings.h> 32 32 #include <unistd.h> 33 33 #include "_libkernel_init.h" 34 + #include <elfcalls.h> 34 35 35 36 extern int mach_init(void); 36 37 ··· 42 43 43 44 /* dlsym() funcptr is for legacy support in exc_catcher */ 44 45 void* (*_dlsym)(void*, const char*) __attribute__((visibility("hidden"))); 46 + extern int strncmp(const char *s1, const char *s2, __SIZE_TYPE__ n); 47 + extern unsigned long long __simple_atoi16(const char* str, const char** endp); 45 48 46 49 __attribute__((visibility("hidden"))) 47 50 _libkernel_functions_t _libkernel_functions; 48 51 52 + __attribute__((visibility("hidden"))) 53 + struct elf_calls* _elfcalls; 49 54 50 55 void 51 56 __libkernel_init(_libkernel_functions_t fns, 52 57 const char *envp[] __attribute__((unused)), 53 - const char *apple[] __attribute__((unused)), 58 + const char *apple[], 54 59 const struct ProgramVars *vars __attribute__((unused))) 55 60 { 61 + int i; 56 62 _libkernel_functions = fns; 57 63 if (fns->dlsym) { 58 64 _dlsym = fns->dlsym; 59 65 } 66 + 67 + for (i = 0; apple[i] != NULL; i++) 68 + { 69 + if (strncmp(apple[i], "elf_calls=", 10) == 0) 70 + { 71 + uintptr_t table = (uintptr_t) __simple_atoi16(apple[i] + 10, NULL); 72 + _elfcalls = (struct elf_calls*) table; 73 + } 74 + } 75 + 60 76 mach_init(); 61 77 }
+1
src/kernel/libsyscall/wrappers/_libkernel_init.h
··· 65 65 void (*pthread_clear_qos_tsd)(mach_port_t); 66 66 67 67 /* Subsequent versions must only add pointers! */ 68 + void (*dyld_func_lookup)(const char*,void**); 68 69 } *_libkernel_functions_t; 69 70 70 71 typedef const struct _libkernel_string_functions {