]> git.saurik.com Git - apple/ld64.git/blame_incremental - unit-tests/test-cases/function-starts/Makefile
ld64-409.12.tar.gz
[apple/ld64.git] / unit-tests / test-cases / function-starts / Makefile
... / ...
CommitLineData
1
2
3TESTROOT = ../..
4include ${TESTROOT}/include/common.makefile
5
6#
7# Check -function_starts
8#
9
10run: all
11
12all:
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 # as static main executable
26 ${CC} ${CCFLAGS} main.c -static -e _main -o main_static -nostdlib -Wl,-new_linker -Wl,-alias,_myexit,_exit
27 ${DYLDINFO} -function_starts main_static | grep _bar | ${FAIL_IF_STDIN}
28 ${CC} ${CCFLAGS} main.c -static -e _main -o main_static -nostdlib -Wl,-new_linker -Wl,-alias,_myexit,_exit -Wl,-function_starts
29 ${DYLDINFO} -function_starts main_static | grep _bar | ${FAIL_IF_EMPTY}
30
31
32 ${PASS_IFF_GOOD_MACHO} main
33
34
35clean:
36 rm main libmain.dylib libmain2.dylib libmain3.dylib main_static