]> git.saurik.com Git - apple/ld64.git/blob - unit-tests/test-cases/function-starts/Makefile
ld64-123.2.tar.gz
[apple/ld64.git] / unit-tests / test-cases / function-starts / Makefile
1
2
3 TESTROOT = ../..
4 include ${TESTROOT}/include/common.makefile
5
6 #
7 # Check -function_starts
8 #
9
10 run: all
11
12 all:
13 # as main executable
14 ${CC} ${CCFLAGS} main.c -o main -Wl,-function_starts
15 ${DYLDINFO} -function_starts main | grep _bar | ${FAIL_IF_EMPTY}
16 # as dylib
17 ${CC} ${CCFLAGS} main.c -dynamiclib -o libmain.dylib -Wl,-function_starts
18 ${DYLDINFO} -function_starts libmain.dylib | grep _bar | ${FAIL_IF_EMPTY}
19 # as dylib with prefered load address
20 ${CC} ${CCFLAGS} main.c -dynamiclib -o libmain2.dylib -seg1addr 0x200000 -Wl,-function_starts
21 ${DYLDINFO} -function_starts libmain2.dylib | grep _bar | ${FAIL_IF_EMPTY}
22 # as dylib with aliases
23 ${CC} ${CCFLAGS} main.c -dynamiclib -o libmain3.dylib -Wl,-function_starts -Wl,-alias,_mid,midalias
24 ${DYLDINFO} -function_starts libmain3.dylib | grep _bar | ${FAIL_IF_EMPTY}
25 ${PASS_IFF_GOOD_MACHO} main
26
27
28 clean:
29 rm main libmain.dylib libmain2.dylib libmain3.dylib