1 #!/bin/bash 2 # SPDX-License-Identifier: GPL-2.0 3 4 set -e 5 set -o pipefail 6 7 # To debug, uncomment the following line 8 # set -x 9 10 # Output from -fpatchable-function-entry can o 11 # should not be invoked for other targets. The 12 # -mabi explicitly, to take care of toolchains 13 14 # Test whether the compile option -fpatchable- 15 # generates appropriate code 16 echo "int func() { return 0; }" | \ 17 $* -m64 -mabi=elfv2 -S -x c -O2 -fpatchabl 18 grep -q "__patchable_function_entries" 19 20 # Test whether nops are generated after the lo 21 echo "int x; int func() { return x; }" | \ 22 $* -m64 -mabi=elfv2 -S -x c -O2 -fpatchabl 23 awk 'BEGIN { RS = ";" } /\.localentry.*nop 24 grep -q "func:" 25 26 exit 0
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.