x86-64: Require BMI2 for AVX2 strcmp implementation
[glibc.git] / sysdeps / x86 / check-cet.awk
blobe953064e766ca472754fad5bb857c81aed81f02c
1 # Verify that all shared objects contain the CET property.
2 # Copyright (C) 2018-2022 Free Software Foundation, Inc.
3 # This file is part of the GNU C Library.
5 # The GNU C Library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
10 # The GNU C Library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with the GNU C Library; if not, see
17 # <https://www.gnu.org/licenses/>.
19 # This awk script expects to get command-line files that are each
20 # the output of 'readelf -n' on a single shared object.
21 # It exits successfully (0) if all of them contained the CET property.
22 # It fails (1) if any didn't contain the CET property
23 # It fails (2) if the input did not take the expected form.
25 BEGIN { result = cet = sanity = 0 }
27 function check_one(name) {
28 if (!sanity) {
29 print name ": *** input did not look like readelf -n output";
30 result = 2;
31 } else if (cet) {
32 print name ": OK";
33 } else {
34 print name ": *** no CET property found";
35 result = result ? result : 1;
38 cet = sanity = 0;
41 FILENAME != lastfile {
42 if (lastfile)
43 check_one(lastfile);
44 lastfile = FILENAME;
47 index ($0, "Displaying notes") != 0 { sanity = 1 }
48 index ($0, "IBT") != 0 && index ($0, "SHSTK") != 0 { cet = 1 }
50 END {
51 check_one(lastfile);
52 exit(result);