chkobjdump.awk 721 B

123456789101112131415161718192021222324252627282930313233
  1. # GNU objdump version checker
  2. #
  3. # Usage:
  4. # objdump -v | awk -f chkobjdump.awk
  5. BEGIN {
  6. # objdump version 2.19 or later is OK for the test.
  7. od_ver = 2;
  8. od_sver = 19;
  9. }
  10. /^GNU objdump/ {
  11. verstr = ""
  12. for (i = 3; i <= NF; i++)
  13. if (match($(i), "^[0-9]")) {
  14. verstr = $(i);
  15. break;
  16. }
  17. if (verstr == "") {
  18. printf("Warning: Failed to find objdump version number.\n");
  19. exit 0;
  20. }
  21. split(verstr, ver, ".");
  22. if (ver[1] > od_ver ||
  23. (ver[1] == od_ver && ver[2] >= od_sver)) {
  24. exit 1;
  25. } else {
  26. printf("Warning: objdump version %s is older than %d.%d\n",
  27. verstr, od_ver, od_sver);
  28. print("Warning: Skipping posttest.");
  29. # Logic is inverted, because we just skip test without error.
  30. exit 0;
  31. }
  32. }