db-symbols.awk 958 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # 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. BEGIN {
  4. %define DB_RTLD_VARIABLE(name) /* Nothing. */
  5. %define DB_MAIN_VARIABLE(name) /* Nothing. */
  6. %define DB_LOOKUP_NAME(idx, name) required[STRINGIFY (name)] = 1;
  7. %define DB_LOOKUP_NAME_TH_UNIQUE(idx, name) th_unique[STRINGIFY (name)] = 1;
  8. %include "db-symbols.h"
  9. in_symtab = 0;
  10. }
  11. /Symbol table '.symtab'/ { in_symtab=1; next }
  12. NF == 0 { in_symtab=0; next }
  13. !in_symtab { next }
  14. NF >= 8 && $7 != "UND" { seen[$NF] = 1 }
  15. END {
  16. status = 0;
  17. for (s in required) {
  18. if (s in seen) print s, "ok";
  19. else {
  20. status = 1;
  21. print s, "***MISSING***";
  22. }
  23. }
  24. any = "";
  25. for (s in th_unique) {
  26. if (s in seen) {
  27. any = s;
  28. break;
  29. }
  30. }
  31. if (any)
  32. print "th_unique:", any;
  33. else {
  34. status = 1;
  35. print "th_unique:", "***MISSING***";
  36. }
  37. exit(status);
  38. }