]>
git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/kernel-pageablekc-fixups.dtest/bar.c
2 #include "../kernel-test-runner.h"
4 extern int kernelExport();
5 __typeof(&kernelExport
) kernelExportPtr
= &kernelExport
;
8 return kernelExportPtr() + 2;
11 extern int kernelExportDirect();
13 // Test direct pointer fixups to the kernel. On x86_64 these would be emitted as just
14 // a branch relocation so we needed to synthesize a stub
15 __attribute__((constructor
))
16 int testDirectToKernel(const TestRunnerFunctions
* funcs
) {
17 LOG("testDirectToKernel(): start");
18 // The kernel returned 42
19 int v
= kernelExportDirect();
21 FAIL("kernelExportDirect() returned %d vs expected 42", v
);
23 LOG("testDirectToKernel(): end");