]> git.saurik.com Git - apple/ld64.git/blobdiff - unit-tests/test-cases/allow_heap_execute/Makefile
ld64-123.2.tar.gz
[apple/ld64.git] / unit-tests / test-cases / allow_heap_execute / Makefile
diff --git a/unit-tests/test-cases/allow_heap_execute/Makefile b/unit-tests/test-cases/allow_heap_execute/Makefile
new file mode 100644 (file)
index 0000000..57c3da7
--- /dev/null
@@ -0,0 +1,35 @@
+
+TESTROOT = ../..
+include ${TESTROOT}/include/common.makefile
+
+#
+# Test the we set the data execute bit for i386
+#
+
+run: run-${ARCH}
+
+run-x86_64:
+       ${PASS_IFF} true
+       
+run-armv6: 
+       ${PASS_IFF} true
+
+run-armv7: 
+       ${PASS_IFF} true
+
+run-ppc:
+       ${PASS_IFF} true
+
+
+run-i386:
+       # Test with the flag
+       ${CC} ${CCFLAGS} main.c -o main-allow -Wl,-allow_heap_execute
+       ${FAIL_IF_BAD_MACHO} main-allow
+       ${OTOOL} -hv main-allow | grep MH_NO_HEAP_EXECUTION | ${FAIL_IF_STDIN}
+       # Test without the flag
+       ${CC} ${CCFLAGS} main.c -o main
+       ${OTOOL} -hv main | grep MH_NO_HEAP_EXECUTION | ${FAIL_IF_EMPTY}
+       ${PASS_IFF_GOOD_MACHO} main
+
+clean:
+       rm -rf main main-allow