this repo has no description
1
fork

Configure Feed

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

Ensure libSystem initialization, prevent conflict with the ELF loader

+6 -6
+1 -1
src/duct/src/CMakeLists.txt
··· 12 12 13 13 SET(duct_sources 14 14 commpage.c libnotify.c numcpus.c 15 - CRGetCrashLogMessage.c acl.c bootstrap.c dyld.c dns_sd.c 15 + CRGetCrashLogMessage.c acl.c bootstrap.c dns_sd.c 16 16 sa_dst_compare.c asl.c) 17 17 18 18 set(DYLIB_INSTALL_NAME "/usr/lib/system/libsystem_duct.dylib")
-4
src/duct/src/dyld.c
··· 1 - void _dyld_initializer(void) 2 - { 3 - } 4 -
+4
src/dyld-apple/src/ImageLoaderMachO.cpp
··· 2379 2379 { 2380 2380 vm_address_t addr = 0; 2381 2381 vm_size_t size = length; 2382 + // In Darling, we're not the only ones doing memory mapping. 2383 + // Therefore, we cannot dictate addresses, because we could (would!) conflict with the ELF loader. 2384 + #ifndef DARLING 2382 2385 // in PIE programs, load initial dylibs after main executable so they don't have fixed addresses either 2383 2386 if ( fgNextPIEDylibAddress != 0 ) { 2384 2387 // add small (0-3 pages) random padding between dylibs ··· 2391 2394 } 2392 2395 fgNextPIEDylibAddress = 0; 2393 2396 } 2397 + #endif 2394 2398 kern_return_t r = vm_alloc(&addr, size, VM_FLAGS_ANYWHERE | VM_MAKE_TAG(VM_MEMORY_DYLIB)); 2395 2399 if ( r != KERN_SUCCESS ) 2396 2400 throw "out of address space";
+1 -1
src/libsystem/init.c
··· 95 95 /* 96 96 * libsyscall_initializer() initializes all of libSystem.dylib <rdar://problem/4892197> 97 97 */ 98 - //static 98 + static __attribute__((constructor)) 99 99 void libSystem_initializer(int argc, const char* argv[], const char* envp[] /*, const char* apple[], const struct ProgramVars* vars*/) 100 100 { 101 101 static const struct _libkernel_functions libkernel_funcs = {