blob: eb089e188a1b99da8eb994d7772b4c475a195a0f [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001# This script processes the output of 'readelf -W -s' on the libpthread.so
2# we've just built. It checks for all the symbols used in td_symbol_list.
3
4BEGIN {
5%define DB_RTLD_VARIABLE(name) /* Nothing. */
6%define DB_MAIN_VARIABLE(name) /* Nothing. */
7%define DB_LOOKUP_NAME(idx, name) required[STRINGIFY (name)] = 1;
8%define DB_LOOKUP_NAME_TH_UNIQUE(idx, name) th_unique[STRINGIFY (name)] = 1;
9%include "db-symbols.h"
10
11 in_symtab = 0;
12}
13
14/Symbol table '.symtab'/ { in_symtab=1; next }
15NF == 0 { in_symtab=0; next }
16
17!in_symtab { next }
18
19NF >= 8 && $7 != "UND" { seen[$NF] = 1 }
20
21END {
22 status = 0;
23
24 for (s in required) {
25 if (s in seen) print s, "ok";
26 else {
27 status = 1;
28 print s, "***MISSING***";
29 }
30 }
31
32 any = "";
33 for (s in th_unique) {
34 if (s in seen) {
35 any = s;
36 break;
37 }
38 }
39 if (any)
40 print "th_unique:", any;
41 else {
42 status = 1;
43 print "th_unique:", "***MISSING***";
44 }
45
46 exit(status);
47}