X-Git-Url: https://git.saurik.com/apple/ld64.git/blobdiff_plain/77cc3118ce7a3a70a0a7364d77ae1eb766a477e7..afe874b1634377ecb27057ee76deb04915bb34d7:/unit-tests/test-cases/switch-jump-table/Makefile diff --git a/unit-tests/test-cases/switch-jump-table/Makefile b/unit-tests/test-cases/switch-jump-table/Makefile index aacd78d..72bc68b 100644 --- a/unit-tests/test-cases/switch-jump-table/Makefile +++ b/unit-tests/test-cases/switch-jump-table/Makefile @@ -25,32 +25,40 @@ include ${TESTROOT}/include/common.makefile # # Test that -mdynamic-no-pic jump table in the middle of -# a function does not cause relocations. +# a function does not cause relocations. # # SPEC2000/eon built with -mdynamic-no-pic won't run # -run: all +all: test-${FILEARCH} -all: + +test-ppc: test-good +test-x86_64: test-good +test-i386: test +test-arm: test + +test: # check jump table in a weak function - ${CC} ${CCFLAGS} main.c switch.s -o main + ${CC} ${CCFLAGS} main.c switch.s -o main -Wl,-no_pie otool -rv main | grep _foo | ${FAIL_IF_STDIN} otool -rv main | grep _bar | ${FAIL_IF_STDIN} # check jump table in a regular function with -flat_namespace - ${CC} ${CCFLAGS} main.c switch.s -o main -flat_namespace + ${CC} ${CCFLAGS} main.c switch.s -o main -flat_namespace -Wl,-no_pie otool -rv main | grep _foo | ${FAIL_IF_STDIN} otool -rv main | grep _bar | ${FAIL_IF_STDIN} # check jump table in a regular function that is interposable - ${CC} ${CCFLAGS} main.c switch.s -o main -Wl,-interposable_list,interpose.exp + ${CC} ${CCFLAGS} main.c switch.s -o main -Wl,-interposable_list,interpose.exp -Wl,-no_pie otool -rv main | grep _foo | ${FAIL_IF_STDIN} otool -rv main | grep _bar | ${FAIL_IF_STDIN} # check jump table with -pie, should have no external and some local relocations ${CC} ${CCFLAGS} main.c switch.s -o main -Wl,-pie -read_only_relocs suppress otool -rv main | grep "External relocation" | ${FAIL_IF_STDIN} - otool -rv main | grep "Local relocation" | ${FAIL_IF_EMPTY} +# otool -rv main | grep "Local relocation" | ${FAIL_IF_EMPTY} ${PASS_IFF_GOOD_MACHO} main +test-good: + ${PASS_IFF} true clean: rm -f main