1 //
2 //  _libc_weak_funcptr.c
3 //  Libsyscall_static
4 //
5 //  Created by Ian Fang on 11/30/21.
6 //
7 //  dyld needs the following definitions to link against Libsyscall_static.
8 //  When building Libsyscall_dynamic, the weak symbols below will get overridden
9 //  by actual implementation.
10 //
11 
12 #include "_libkernel_init.h"
13 
14 __attribute__((weak, visibility("hidden")))
15 void *
malloc(__unused size_t size)16 malloc(__unused size_t size)
17 {
18 	return NULL;
19 }
20 
21 __attribute__((weak, visibility("hidden")))
22 mach_msg_size_t
voucher_mach_msg_fill_aux(__unused mach_msg_aux_header_t * aux_hdr,__unused mach_msg_size_t sz)23 voucher_mach_msg_fill_aux(__unused mach_msg_aux_header_t *aux_hdr,
24     __unused mach_msg_size_t sz)
25 {
26 	return 0;
27 }
28 
29 __attribute__((weak, visibility("hidden")))
30 boolean_t
voucher_mach_msg_fill_aux_supported(void)31 voucher_mach_msg_fill_aux_supported(void)
32 {
33 	return FALSE;
34 }
35