]> git.saurik.com Git - apple/dyld.git/blobdiff - testing/kernel-cache-tests/vtable-patching-metaclass-alias/foo.c
dyld-832.7.1.tar.gz
[apple/dyld.git] / testing / kernel-cache-tests / vtable-patching-metaclass-alias / foo.c
diff --git a/testing/kernel-cache-tests/vtable-patching-metaclass-alias/foo.c b/testing/kernel-cache-tests/vtable-patching-metaclass-alias/foo.c
new file mode 100644 (file)
index 0000000..5b7b9be
--- /dev/null
@@ -0,0 +1,10 @@
+
+// This is the symbol xnu now exports
+extern int symbol_from_xnu() __asm("__ZN15OSMetaClassBase8DispatchE5IORPC");
+
+// And this is the old symbol it needs to implicitly alias to the above symbol
+extern int symbol_from_xnu_implicit_alias() __asm("__ZN15OSMetaClassBase25_RESERVEDOSMetaClassBase3Ev");
+
+int foo() {
+       return symbol_from_xnu() + symbol_from_xnu_implicit_alias();
+}