]>
git.saurik.com Git - apple/dyld.git/blob - testing/kernel-cache-tests/rwx-permissions-error/test.py
4 import KernelCollection
6 # Check errors from canBePlacedInKernelCollection()
7 # All arm64* binaries cannot use RWX permissions
9 def check ( kernel_cache
):
10 kernel_cache
. buildKernelCollection ( "arm64" , "/rwx-permissions-error/main.kc" , "/rwx-permissions-error/main.kernel" , "" , [], [ "-json-errors" ])
11 assert len ( kernel_cache
. dictionary ()) == 1
13 assert kernel_cache
. dictionary ()[ 0 ][ "id" ] == "com.apple.kernel"
14 assert len ( kernel_cache
. dictionary ()[ 0 ][ "errors" ]) == 1
15 assert kernel_cache
. dictionary ()[ 0 ][ "errors" ][ 0 ] == "cannot be placed in kernel collection because: Segments are not allowed to be both writable and executable"
18 # [~]> xcrun -sdk iphoneos cc -arch arm64 -Wl,-static -mkernel -nostdlib -Wl,-add_split_seg_info -Wl,-rename_section,__TEXT,__text,__TEXT_EXEC,__text -Wl,-e,__start -Wl,-pagezero_size,0x0 -Wl,-pie -segprot __RWX rwx rwx main.c -o main.kernel