weak.c 717 B

123456789101112131415161718192021222324252627282930313233343536
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * Copyright (C) 2020 Matt Helsley <mhelsley@vmware.com>
  4. * Weak definitions necessary to compile objtool without
  5. * some subcommands (e.g. check, orc).
  6. */
  7. #include <stdbool.h>
  8. #include <errno.h>
  9. #include "objtool.h"
  10. #define UNSUPPORTED(name) \
  11. ({ \
  12. fprintf(stderr, "error: objtool: " name " not implemented\n"); \
  13. return ENOSYS; \
  14. })
  15. int __weak check(struct objtool_file *file)
  16. {
  17. UNSUPPORTED("check subcommand");
  18. }
  19. int __weak orc_dump(const char *_objname)
  20. {
  21. UNSUPPORTED("orc");
  22. }
  23. int __weak create_orc(struct objtool_file *file)
  24. {
  25. UNSUPPORTED("orc");
  26. }
  27. int __weak create_orc_sections(struct objtool_file *file)
  28. {
  29. UNSUPPORTED("orc");
  30. }