about summary refs log tree commit diff
path: root/nptl_db/db-symbols.awk
blob: fe90d3b4357aba6dc24d53683355aa42017f563c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# This script processes the output of 'readelf -W -D -s' on the libc.so
# we've just built.  It checks for all the symbols used in td_symbol_list.

BEGIN {
%define DB_MAIN_VARIABLE(name) /* Nothing. */
%define DB_MAIN_SYMBOL(name) /* Nothing. */
%define DB_MAIN_ARRAY_VARIABLE(name) /* Nothing. */
%define DB_LOOKUP_NAME(idx, name)		required[STRINGIFY (name)] = 1;
%define DB_LOOKUP_NAME_TH_UNIQUE(idx, name)	th_unique[STRINGIFY (name)] = 1;
%include "db-symbols.h"

   in_symtab = 0;
}

/Symbol table for image/ { in_symtab=1; next }
NF == 0 { in_symtab=0; next }

!in_symtab { next }

NF >= 8 && $7 != "UND" { seen[$NF] = 1 }

END {
  status = 0;

  for (s in required) {
    s = s "@@GLIBC_PRIVATE"
    if (s in seen) print s, "ok";
    else {
      status = 1;
      print s, "***MISSING***";
    }
  }

  any = "";
  for (s in th_unique) {
    s = s "@@GLIBC_PRIVATE"
    if (s in seen) {
      any = s;
      break;
    }
  }
  if (any)
    print "th_unique:", any;
  else {
    status = 1;
    print "th_unique:", "***MISSING***";
  }

  exit(status);
}