1#!/bin/sh 2 3# program 4# <- liba.so 5# <- libb.so 6# <- libb_dependency.so 7# 8# Expected: Undefined symbol in program resolves to symbol in liba.so, 9# not to symbol in libb_dependency.so. 10 11 12. ./test_setup 13 14 15# create liba.so 16cat > liba.c << EOI 17int a() { return 1; } 18EOI 19 20# build 21compile_lib -o liba.so liba.c 22 23 24# create libb_dependency.so 25cat > libb_dependency.c << EOI 26int a() { return 2; } 27EOI 28 29# build 30compile_lib -o libb_dependency.so libb_dependency.c 31 32 33# create libb.so 34cat > libb.c << EOI 35int b() { return 1; } 36EOI 37 38# build 39compile_lib -o libb.so libb.c ./libb_dependency.so 40 41 42# create program 43cat > program.c << EOI 44extern int a(); 45int 46main() 47{ 48 return a(); 49} 50EOI 51 52# build 53compile_program -o program program.c ./liba.so ./libb.so 54 55# run 56test_run_ok ./program 1 57 58