]> granicus.if.org Git - strace/commit
tests: robustify strace -k tests against link-time optimizer
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 9 Jul 2019 19:27:58 +0000 (19:27 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 9 Jul 2019 19:27:58 +0000 (19:27 +0000)
commite9ff1e84081f89f24e27edc9dcfad12c43e51ec3
tree59373f4530d0bfebd5525ac7911bdb1650fce8ea
parent3efa68a0ffa1c2eda414941f546e1626279e10d2
tests: robustify strace -k tests against link-time optimizer

Some distributions enable by default a link-time optimizer that
mangles stack_fcall sample executables in a way that renders them
unusable for test purposes.

Robustify tests to defeat link-time optimizer.

* tests/stack-fcall.h (f0, f1, f2, f3): Add second parameter.
* tests/stack-fcall.c (main): Pass main as the second parameter to f0.
* tests/stack-fcall-0.c (f0): Add second parameter f, pass the xor of it
and f0 to f1.
* tests/stack-fcall-1.c (f1): Add second parameter f, pass the xor of it
and f1 to f2.
* tests/stack-fcall-2.c (f2): Add second parameter f, pass the xor of it
and f2 to f3.
* tests/stack-fcall-3.c: Include <asm/unistd.h>.
(f3): Add second parameter f, invoke __NR_gettid syscall with the xor
of f and f3 as its argument.
tests/stack-fcall-0.c
tests/stack-fcall-1.c
tests/stack-fcall-2.c
tests/stack-fcall-3.c
tests/stack-fcall.c
tests/stack-fcall.h