#include <stdio.h> // fprintf(), NULL
#include <stdlib.h> // exit(), EXIT_SUCCESS
#include <unistd.h>
+#include <Availability.h>
#include <mach-o/getsect.h>
#include <mach/mach.h>
#include <mach/mach_vm.h>
#include "test.h" // PASS(), FAIL(), XPASS(), XFAIL()
+#if __MAC_OS_X_VERSION_MIN_REQUIRED
extern void foo();
extern int fooData;
#elif __x86_64__
return getsectdata("__TEXT", "__symbol_stub1", &size);
#elif __arm__
- return getsectdata("__TEXT", "__symbol_stub4", &size);
+ void* p = getsectdata("__TEXT", "__symbol_stub4", &size);
+ if ( p != NULL )
+ return p;
+ return getsectdata("__TEXT", "__symbolstub1", &size);
#else
#error unknown arch
#endif
return EXIT_SUCCESS;
}
+#else
+
+int main()
+{
+ // iOS does not have modifiable stubs
+ PASS("read-only-stubs");
+ return EXIT_SUCCESS;
+}
+
+#endif