README.md: x86-32/64 support
[centaur.git] / tests / 07-dynlink-globalvar.test
1 #!/bin/sh
2
3 # 1. Inject a freshly built object file into a fresh executable.
4 #    Both use a dynamically loaded function and global variable.
5 # 2. Detour execution from a function in the executable to a function
6 #    originating from the object file.
7 # 3. Check if the new executable prints the expected changed output.
8
9 source ./boilerplate.sh
10
11 elfucli --input $BUILDDIR/putsmainsubglobal \
12         --reladd $BUILDDIR/sub_with_global.o \
13         --detour sub,sub_with_global \
14         --output $BUILDDIR/putsmainsubglobal-with-sub-with-global-detour
15 test_check_retval
16
17 $BUILDDIR/putsmainsubglobal-with-sub-with-global-detour | grep -q "sub_with_global() is returning."
18 test_check_retval