3 # get the directory of this script
5 # If it does not begin with /, then it is relative to the current working directory
6 if [ "${origin:0:1}" != "/" ]; then
9 origin
=`dirname "$origin"`
10 # origin="/home/monads/Public/pin-2.13-62141-gcc.4.4.7-linux"
11 origin
="/home/monads/Public/pin-2.13-62732-gcc.4.4.7-linux"
13 # Libraries are found relative to origin
15 elf_libs
="$lib_base/ia32/runtime:$lib_base/intel64/runtime"
16 if [ `$origin/source/tools/Utils/testGccVersion /usr/bin/gcc` -eq 1 ]
18 cpp_libs
="$lib_base/ia32/runtime/cpplibs:$lib_base/intel64/runtime/cpplibs"
22 glibc_libs
="$lib_base/ia32/runtime/glibc:$lib_base/intel64/runtime/glibc"
23 # vm/tool need elf, cpp and glibc libs
24 export PIN_VM_LD_LIBRARY_PATH
=$elf_libs:$cpp_libs:$glibc_libs:$LD_LIBRARY_PATH
26 # If variables we are going to modify are set, save the value. They will be restored
27 # after the injector starts
28 export PIN_LD_RESTORE_REQUIRED
=t
29 if [ -n "${LD_LIBRARY_PATH+x}" ]
31 export PIN_APP_LD_LIBRARY_PATH
=$LD_LIBRARY_PATH
34 if [ -n "${LD_ASSUME_KERNEL+x}" ]
36 export PIN_APP_LD_ASSUME_KERNEL
=$LD_ASSUME_KERNEL
38 unset LD_ASSUME_KERNEL
40 if [ -n "${LD_BIND_NOW+x}" ]
42 export PIN_APP_LD_BIND_NOW
=$LD_BIND_NOW
45 if [ -n "${LD_PRELOAD+x}" ]
47 export PIN_APP_LD_PRELOAD
=$LD_PRELOAD
51 # injector just needs elf and cpp libs, it cannot use glibc libs
52 export LD_LIBRARY_PATH
=$elf_libs:$cpp_libs:$LD_LIBRARY_PATH
54 # exec "$origin"/ia32/bin/pinbin -p64 "$origin"/intel64/bin/pinbin "${@}"
55 exec "$origin"/intel64
/bin
/pinbin
"${@}"