4 include ${TESTROOT}/include/common.makefile
7 # Check -function_starts
14 ${CC} ${CCFLAGS} main.c -o main -Wl,-function_starts
15 ${DYLDINFO} -function_starts main | grep _bar | ${FAIL_IF_EMPTY}
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}
32 ${PASS_IFF_GOOD_MACHO} main
36 rm main libmain.dylib libmain2.dylib libmain3.dylib main_static